diff options
Diffstat (limited to 'spec/ruby/core/array/plus_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/plus_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/array/plus_spec.rb b/spec/ruby/core/array/plus_spec.rb index 635bd131c9..7ead927fc0 100644 --- a/spec/ruby/core/array/plus_spec.rb +++ b/spec/ruby/core/array/plus_spec.rb @@ -21,15 +21,15 @@ describe "Array#+" do ([1, 2, 3] + obj).should == [1, 2, 3, "x", "y"] end - it "raises a Typeerror if the given argument can't be converted to an array" do - -> { [1, 2, 3] + nil }.should raise_error(TypeError) - -> { [1, 2, 3] + "abc" }.should raise_error(TypeError) + it "raises a TypeError if the given argument can't be converted to an array" do + -> { [1, 2, 3] + nil }.should.raise(TypeError) + -> { [1, 2, 3] + "abc" }.should.raise(TypeError) end it "raises a NoMethodError if the given argument raises a NoMethodError during type coercion to an Array" do obj = mock("hello") obj.should_receive(:to_ary).and_raise(NoMethodError) - -> { [1, 2, 3] + obj }.should raise_error(NoMethodError) + -> { [1, 2, 3] + obj }.should.raise(NoMethodError) end end @@ -45,9 +45,9 @@ describe "Array#+" do end it "does return subclass instances with Array subclasses" do - (ArraySpecs::MyArray[1, 2, 3] + []).should be_an_instance_of(Array) - (ArraySpecs::MyArray[1, 2, 3] + ArraySpecs::MyArray[]).should be_an_instance_of(Array) - ([1, 2, 3] + ArraySpecs::MyArray[]).should be_an_instance_of(Array) + (ArraySpecs::MyArray[1, 2, 3] + []).should.instance_of?(Array) + (ArraySpecs::MyArray[1, 2, 3] + ArraySpecs::MyArray[]).should.instance_of?(Array) + ([1, 2, 3] + ArraySpecs::MyArray[]).should.instance_of?(Array) end it "does not call to_ary on array subclasses" do |
