diff options
author | Benoit Daloze <eregontp@gmail.com> | 2020-11-27 14:55:31 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2020-11-27 14:55:31 +0100 |
commit | f02d2f82bf10351f480ea312f40cb840e2437f93 (patch) | |
tree | 0b53098bffe6dacadb09880183ebcaea06e95153 /spec/ruby/language/hash_spec.rb | |
parent | f0bfa266d70651dc295a63b026938b246693499b (diff) |
Update to ruby/spec@ac878ad
Diffstat (limited to 'spec/ruby/language/hash_spec.rb')
-rw-r--r-- | spec/ruby/language/hash_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/ruby/language/hash_spec.rb b/spec/ruby/language/hash_spec.rb index 630c9d2364..d6600ddb4a 100644 --- a/spec/ruby/language/hash_spec.rb +++ b/spec/ruby/language/hash_spec.rb @@ -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 |