Created
February 20, 2010 03:44
-
-
Save methodmissing/309485 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HashExtTest < Test::Unit::TestCase | |
def setup | |
@strings = { 'a' => 1, 'b' => 2 } | |
@symbols = { :a => 1, :b => 2 } | |
@mixed = { :a => 1, 'b' => 2 } | |
@fixnums = { 0 => 1, 1 => 2 } | |
if RUBY_VERSION < '1.9.0' | |
@illegal_symbols = { "\0" => 1, "" => 2, [] => 3 } | |
else | |
@illegal_symbols = { [] => 3 } | |
end | |
end | |
def test_symbolize_keys_preserves_keys_that_cant_be_symbolized | |
assert_equal @illegal_symbols, @illegal_symbols.symbolize_keys | |
assert_equal @illegal_symbols, @illegal_symbols.dup.symbolize_keys! | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment