diff options
Diffstat (limited to 'spec/ruby/core/math/log2_spec.rb')
| -rw-r--r-- | spec/ruby/core/math/log2_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/math/log2_spec.rb b/spec/ruby/core/math/log2_spec.rb index 1594f2d7af..e38a8bb67f 100644 --- a/spec/ruby/core/math/log2_spec.rb +++ b/spec/ruby/core/math/log2_spec.rb @@ -15,24 +15,24 @@ describe "Math.log2" do Math.log2((2**301+45677544234809571)).should == 301.0 end - it "raises an Errno::EDOM if the argument is less than 0" do - -> { Math.log2(-1e-15) }.should raise_error( Math::DomainError) + it "raises Math::DomainError if the argument is less than 0" do + -> { Math.log2(-1e-15) }.should.raise( Math::DomainError) end it "raises a TypeError if the argument cannot be coerced with Float()" do - -> { Math.log2("test") }.should raise_error(TypeError) + -> { Math.log2("test") }.should.raise(TypeError) end it "raises a TypeError if passed a numerical argument as a string" do - -> { Math.log2("1.0") }.should raise_error(TypeError) + -> { Math.log2("1.0") }.should.raise(TypeError) end it "returns NaN given NaN" do - Math.log2(nan_value).nan?.should be_true + Math.log2(nan_value).nan?.should == true end it "raises a TypeError if the argument is nil" do - -> { Math.log2(nil) }.should raise_error(TypeError) + -> { Math.log2(nil) }.should.raise(TypeError) end it "accepts any argument that can be coerced with Float()" do |
