summaryrefslogtreecommitdiff
path: root/spec/ruby/core/data/to_h_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/data/to_h_spec.rb')
-rw-r--r--spec/ruby/core/data/to_h_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/data/to_h_spec.rb b/spec/ruby/core/data/to_h_spec.rb
index 64816b7251..41925cf3b2 100644
--- a/spec/ruby/core/data/to_h_spec.rb
+++ b/spec/ruby/core/data/to_h_spec.rb
@@ -28,18 +28,18 @@ describe "Data#to_h" do
data = DataSpecs::Measure.new(amount: 42, unit: 'km')
-> do
data.to_h { |k, v| [k.to_s, v*v, 1] }
- end.should raise_error(ArgumentError, /element has wrong array length/)
+ end.should.raise(ArgumentError, /element has wrong array length/)
-> do
data.to_h { |k, v| [k] }
- end.should raise_error(ArgumentError, /element has wrong array length/)
+ end.should.raise(ArgumentError, /element has wrong array length/)
end
it "raises TypeError if block returns something other than Array" do
data = DataSpecs::Measure.new(amount: 42, unit: 'km')
-> do
data.to_h { |k, v| "not-array" }
- end.should raise_error(TypeError, /wrong element type String/)
+ end.should.raise(TypeError, /wrong element type String/)
end
it "coerces returned pair to Array with #to_ary" do
@@ -57,7 +57,7 @@ describe "Data#to_h" do
-> do
data.to_h { |k| x }
- end.should raise_error(TypeError, /wrong element type MockObject/)
+ end.should.raise(TypeError, /wrong element type MockObject/)
end
end
end