We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d00685b commit 5c25e5eCopy full SHA for 5c25e5e
spec/ruby/language/hash_spec.rb
@@ -149,6 +149,12 @@ def h.to_hash; {:b => 2, :c => 3}; end
149
-> { {**obj} }.should raise_error(TypeError)
150
end
151
152
+ it "raises a TypeError if the object does not respond to #to_hash" do
153
+ obj = 42
154
+ -> { {**obj} }.should raise_error(TypeError)
155
+ -> { {a: 1, **obj} }.should raise_error(TypeError)
156
+ end
157
+
158
it "does not change encoding of literal string keys during creation" do
159
binary_hash = HashStringsBinary.literal_hash
160
utf8_hash = HashStringsUTF8.literal_hash
0 commit comments