test/representation_test.rb in loquor-0.1.2 vs test/representation_test.rb in loquor-0.2.0
- old
+ new
@@ -5,9 +5,24 @@
def test_is_accessible_as_a_hash
representation = Representation.new({foo: "bar"})
assert_equal "bar", representation[:foo]
end
+ def test_hash_symbol_keys_are_accessible_as_strings
+ representation = Representation.new({foo: "bar"})
+ assert_equal "bar", representation["foo"]
+ end
+
+ def test_hash_string_keys_are_accessible_as_symbols
+ representation = Representation.new({"foo" => "bar"})
+ assert_equal "bar", representation[:foo]
+ end
+
+ def test_hash_keys_are_accessible_as_orignals
+ representation = Representation.new({1 => "bar"})
+ assert_equal "bar", representation[1]
+ end
+
def test_hash_keys_are_accessible_via_methods
representation = Representation.new({foo: "bar"})
assert_equal "bar", representation.foo
end
end