Sha256: f5dda71c91260ff7eb921d1871e00b8ae8dc86ae65d957dbffea82f9c05a0cf2

Contents?: true

Size: 635 Bytes

Versions: 25

Compression:

Stored size: 635 Bytes

Contents

require File.expand_path(__FILE__).sub(%r(/test/.*), '/test/test_helper.rb')
require File.expand_path(__FILE__).sub(%r(.*/test/), '').sub(/test_(.*)\.rb/,'\1')

class TestClass < Test::Unit::TestCase
  def test_indiferent_hash
    a = {:a => 1, "b" => 2}
    a.extend IndiferentHash

    assert_equal 1, a[:a]
    assert_equal 1, a["a"]
    assert_equal 2, a["b"]
    assert_equal 2, a[:b]
  end

  def test_case_insensitive_hash
    a = {:a => 1, "b" => 2}
    a.extend CaseInsensitiveHash

    assert_equal 1, a[:a]
    assert_equal 1, a["A"]
    assert_equal 1, a[:A]
    assert_equal 2, a["B"]
    assert_equal 2, a[:b]
  end
end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
scout-essentials-1.6.4 test/scout/test_indiferent_hash.rb
scout-essentials-1.6.3 test/scout/test_indiferent_hash.rb
scout-essentials-1.6.2 test/scout/test_indiferent_hash.rb
scout-essentials-1.6.1 test/scout/test_indiferent_hash.rb
scout-essentials-1.6.0 test/scout/test_indiferent_hash.rb
scout-essentials-1.3.1 test/scout/test_indiferent_hash.rb
scout-essentials-1.3.0 test/scout/test_indiferent_hash.rb
scout-essentials-1.2.0 test/scout/test_indiferent_hash.rb
scout-essentials-1.1.1 test/scout/test_indiferent_hash.rb
scout-essentials-1.1.0 test/scout/test_indiferent_hash.rb
scout-essentials-1.0.0 test/scout/test_indiferent_hash.rb
scout-gear-9.1.0 test/scout/test_indiferent_hash.rb
scout-gear-9.0.0 test/scout/test_indiferent_hash.rb
scout-gear-8.1.0 test/scout/test_indiferent_hash.rb
scout-gear-8.0.0 test/scout/test_indiferent_hash.rb
scout-gear-7.3.0 test/scout/test_indiferent_hash.rb
scout-gear-7.2.0 test/scout/test_indiferent_hash.rb
scout-gear-7.1.0 test/scout/test_indiferent_hash.rb
scout-gear-6.0.0 test/scout/test_indiferent_hash.rb
scout-gear-5.2.0 test/scout/test_indiferent_hash.rb