1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2020-11-27 14:55:31 +01:00
parent f0bfa266d7
commit f02d2f82bf
17 changed files with 214 additions and 3 deletions

View file

@ -149,6 +149,12 @@ describe "Hash literal" do
-> { {**obj} }.should raise_error(TypeError)
end
it "raises a TypeError if the object does not respond to #to_hash" do
obj = 42
-> { {**obj} }.should raise_error(TypeError)
-> { {a: 1, **obj} }.should raise_error(TypeError)
end
it "does not change encoding of literal string keys during creation" do
binary_hash = HashStringsBinary.literal_hash
utf8_hash = HashStringsUTF8.literal_hash