Added test for looping in order
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
9f146ea0ac
commit
ab2a24de9d
@ -20,4 +20,18 @@ def test_usage
|
||||
assert_equal 2, a.size
|
||||
assert_equal 56, a[:else_where]
|
||||
end
|
||||
|
||||
def test_looping
|
||||
a = OrderedOptions.new
|
||||
|
||||
a[:allow_concurreny] = true
|
||||
a["else_where"] = 56
|
||||
|
||||
test = [[:allow_concurreny, true], [:else_where, 56]]
|
||||
|
||||
a.each_with_index do |(key, value), index|
|
||||
assert_equal test[index].first, key
|
||||
assert_equal test[index].last, value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user