diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-30 07:02:28 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-09-30 07:02:28 +0000 |
commit | ab2a24de9d7858a08a6f364752297bb4f4cfa30d (patch) | |
tree | 0321b96f764665106dd048fc80628b7be52ee4ed | |
parent | 9f146ea0ac904252b16be1c4017604aed0c383f7 (diff) | |
download | rails-ab2a24de9d7858a08a6f364752297bb4f4cfa30d.tar.gz rails-ab2a24de9d7858a08a6f364752297bb4f4cfa30d.tar.bz2 rails-ab2a24de9d7858a08a6f364752297bb4f4cfa30d.zip |
Added test for looping in order
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activesupport/test/ordered_options_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/ordered_options_test.rb b/activesupport/test/ordered_options_test.rb index c47e945c24..83a3e2e561 100644 --- a/activesupport/test/ordered_options_test.rb +++ b/activesupport/test/ordered_options_test.rb @@ -20,4 +20,18 @@ class OrderedOptionsTest < Test::Unit::TestCase 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 |