summaryrefslogtreecommitdiff
path: root/spec/ruby/library/datetime/deconstruct_keys_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/datetime/deconstruct_keys_spec.rb')
-rw-r--r--spec/ruby/library/datetime/deconstruct_keys_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/library/datetime/deconstruct_keys_spec.rb b/spec/ruby/library/datetime/deconstruct_keys_spec.rb
index 154c024a23..07a7bda881 100644
--- a/spec/ruby/library/datetime/deconstruct_keys_spec.rb
+++ b/spec/ruby/library/datetime/deconstruct_keys_spec.rb
@@ -18,16 +18,16 @@ describe "DateTime#deconstruct_keys" do
it "requires one argument" do
-> {
DateTime.new(2022, 10, 5, 13, 30).deconstruct_keys
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
it "it raises error when argument is neither nil nor array" do
d = DateTime.new(2022, 10, 5, 13, 30)
- -> { d.deconstruct_keys(1) }.should raise_error(TypeError, "wrong argument type Integer (expected Array or nil)")
- -> { d.deconstruct_keys("asd") }.should raise_error(TypeError, "wrong argument type String (expected Array or nil)")
- -> { d.deconstruct_keys(:x) }.should raise_error(TypeError, "wrong argument type Symbol (expected Array or nil)")
- -> { d.deconstruct_keys({}) }.should raise_error(TypeError, "wrong argument type Hash (expected Array or nil)")
+ -> { d.deconstruct_keys(1) }.should.raise(TypeError, "wrong argument type Integer (expected Array or nil)")
+ -> { d.deconstruct_keys("asd") }.should.raise(TypeError, "wrong argument type String (expected Array or nil)")
+ -> { d.deconstruct_keys(:x) }.should.raise(TypeError, "wrong argument type Symbol (expected Array or nil)")
+ -> { d.deconstruct_keys({}) }.should.raise(TypeError, "wrong argument type Hash (expected Array or nil)")
end
it "returns {} when passed []" do