summaryrefslogtreecommitdiff
path: root/spec/ruby/core/queue/initialize_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/queue/initialize_spec.rb')
-rw-r--r--spec/ruby/core/queue/initialize_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/ruby/core/queue/initialize_spec.rb b/spec/ruby/core/queue/initialize_spec.rb
index 592fbe2487..080e4d0abd 100644
--- a/spec/ruby/core/queue/initialize_spec.rb
+++ b/spec/ruby/core/queue/initialize_spec.rb
@@ -35,26 +35,26 @@ describe "Queue#initialize" do
end
it "raises a TypeError if the given argument can't be converted to an Array" do
- -> { Queue.new(42) }.should raise_error(TypeError)
- -> { Queue.new(:abc) }.should raise_error(TypeError)
+ -> { Queue.new(42) }.should.raise(TypeError)
+ -> { Queue.new(:abc) }.should.raise(TypeError)
end
it "raises a NoMethodError if the given argument raises a NoMethodError during type coercion to an Array" do
enumerable = MockObject.new('mock-enumerable')
enumerable.should_receive(:to_a).and_raise(NoMethodError)
- -> { Queue.new(enumerable) }.should raise_error(NoMethodError)
+ -> { Queue.new(enumerable) }.should.raise(NoMethodError)
end
end
it "raises TypeError if the provided Enumerable does not respond to #to_a" do
enumerable = MockObject.new('mock-enumerable')
- -> { Queue.new(enumerable) }.should raise_error(TypeError, "can't convert MockObject into Array")
+ -> { Queue.new(enumerable) }.should.raise(TypeError, "can't convert MockObject into Array")
end
it "raises TypeError if #to_a does not return Array" do
enumerable = MockObject.new('mock-enumerable')
enumerable.should_receive(:to_a).and_return("string")
- -> { Queue.new(enumerable) }.should raise_error(TypeError, "can't convert MockObject to Array (MockObject#to_a gives String)")
+ -> { Queue.new(enumerable) }.should raise_consistent_error(TypeError, "can't convert MockObject into Array (MockObject#to_a gives String)")
end
end