aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_options_test.rb
blob: c47e945c2462c732209b47e81a08390bd10505a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
require 'test/unit'

require File.dirname(__FILE__) + '/../lib/active_support/ordered_options'

class OrderedOptionsTest < Test::Unit::TestCase
  def test_usage
    a = OrderedOptions.new

    assert_nil a[:not_set]

    a[:allow_concurreny] = true    
    assert_equal 1, a.size
    assert a[:allow_concurreny]

    a[:allow_concurreny] = false
    assert_equal 1, a.size
    assert !a[:allow_concurreny]

    a["else_where"] = 56
    assert_equal 2, a.size
    assert_equal 56, a[:else_where]
  end
end