Skip to content
Snippets Groups Projects
Commit 1e6a0915 authored by emanreyalp's avatar emanreyalp
Browse files

Added test for complicated routes

parent 78eb7538
No related branches found
No related tags found
No related merge requests found
...@@ -53,4 +53,36 @@ class TestJouney < Test::Unit::TestCase ...@@ -53,4 +53,36 @@ class TestJouney < Test::Unit::TestCase
elements = journey.elements elements = journey.elements
assert_equal(["u", "v"], elements) assert_equal(["u", "v"], elements)
end end
def test_two_independent_route
journey = Journey.new
inserts = [
{:station=>"u"},
{:station=>"v", :criteria=>"w"},
{:station=>"w", :criteria=>"z"},
{:station=>"x", :criteria=>"u"},
{:station=>"y", :criteria=>"v"},
{:station=>"z"}
]
inserts.each {|i| journey.insert(i) }
elements = journey.elements
assert_equal(["x", "u", "y", "v", "w", "z"], elements)
end
def test_two_independent_route_mixed_inserts
journey = Journey.new
inserts = [
{:station=>"y", :criteria=>"v"},
{:station=>"u"},
{:station=>"v", :criteria=>"w"},
{:station=>"x", :criteria=>"u"},
{:station=>"w", :criteria=>"z"},
{:station=>"z"}
]
inserts.each {|i| journey.insert(i) }
elements = journey.elements
assert_equal(["y", "x", "u", "v", "w", "z"], elements)
end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment