summaryrefslogtreecommitdiff
path: root/spec/ruby/core/float/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/float/shared')
-rw-r--r--spec/ruby/core/float/shared/abs.rb2
-rw-r--r--spec/ruby/core/float/shared/arg.rb4
-rw-r--r--spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb2
-rw-r--r--spec/ruby/core/float/shared/comparison_exception_in_coerce.rb2
-rw-r--r--spec/ruby/core/float/shared/modulo.rb12
-rw-r--r--spec/ruby/core/float/shared/quo.rb8
-rw-r--r--spec/ruby/core/float/shared/to_i.rb14
-rw-r--r--spec/ruby/core/float/shared/to_s.rb4
8 files changed, 24 insertions, 24 deletions
diff --git a/spec/ruby/core/float/shared/abs.rb b/spec/ruby/core/float/shared/abs.rb
index 607983322d..ab21480e24 100644
--- a/spec/ruby/core/float/shared/abs.rb
+++ b/spec/ruby/core/float/shared/abs.rb
@@ -16,6 +16,6 @@ describe :float_abs, shared: true do
end
it "returns NaN if NaN" do
- nan_value.send(@method).nan?.should be_true
+ nan_value.send(@method).nan?.should == true
end
end
diff --git a/spec/ruby/core/float/shared/arg.rb b/spec/ruby/core/float/shared/arg.rb
index 136cf19ec8..de0024313d 100644
--- a/spec/ruby/core/float/shared/arg.rb
+++ b/spec/ruby/core/float/shared/arg.rb
@@ -1,12 +1,12 @@
describe :float_arg, shared: true do
it "returns NaN if NaN" do
f = nan_value
- f.send(@method).nan?.should be_true
+ f.send(@method).nan?.should == true
end
it "returns self if NaN" do
f = nan_value
- f.send(@method).should equal(f)
+ f.send(@method).should.equal?(f)
end
it "returns 0 if positive" do
diff --git a/spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb b/spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb
index eec92d858f..bd3bf9019f 100644
--- a/spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb
+++ b/spec/ruby/core/float/shared/arithmetic_exception_in_coerce.rb
@@ -6,6 +6,6 @@ describe :float_arithmetic_exception_in_coerce, shared: true do
b.should_receive(:coerce).and_raise(FloatSpecs::CoerceError)
# e.g. 1.0 > b
- -> { 1.0.send(@method, b) }.should raise_error(FloatSpecs::CoerceError)
+ -> { 1.0.send(@method, b) }.should.raise(FloatSpecs::CoerceError)
end
end
diff --git a/spec/ruby/core/float/shared/comparison_exception_in_coerce.rb b/spec/ruby/core/float/shared/comparison_exception_in_coerce.rb
index 3e2c1e28dd..eec5d8daf9 100644
--- a/spec/ruby/core/float/shared/comparison_exception_in_coerce.rb
+++ b/spec/ruby/core/float/shared/comparison_exception_in_coerce.rb
@@ -6,6 +6,6 @@ describe :float_comparison_exception_in_coerce, shared: true do
b.should_receive(:coerce).and_raise(FloatSpecs::CoerceError)
# e.g. 1.0 > b
- -> { 1.0.send(@method, b) }.should raise_error(FloatSpecs::CoerceError)
+ -> { 1.0.send(@method, b) }.should.raise(FloatSpecs::CoerceError)
end
end
diff --git a/spec/ruby/core/float/shared/modulo.rb b/spec/ruby/core/float/shared/modulo.rb
index 6700bd4f4e..1efee1476d 100644
--- a/spec/ruby/core/float/shared/modulo.rb
+++ b/spec/ruby/core/float/shared/modulo.rb
@@ -16,13 +16,13 @@ describe :float_modulo, shared: true do
end
it "returns NaN when called on NaN or Infinities" do
- Float::NAN.send(@method, 42).should be_nan
- Float::INFINITY.send(@method, 42).should be_nan
- (-Float::INFINITY).send(@method, 42).should be_nan
+ Float::NAN.send(@method, 42).should.nan?
+ Float::INFINITY.send(@method, 42).should.nan?
+ (-Float::INFINITY).send(@method, 42).should.nan?
end
it "returns NaN when modulus is NaN" do
- 4.2.send(@method, Float::NAN).should be_nan
+ 4.2.send(@method, Float::NAN).should.nan?
end
it "returns -0.0 when called on -0.0 with a non zero modulus" do
@@ -42,7 +42,7 @@ describe :float_modulo, shared: true do
end
it "raises a ZeroDivisionError if other is zero" do
- -> { 1.0.send(@method, 0) }.should raise_error(ZeroDivisionError)
- -> { 1.0.send(@method, 0.0) }.should raise_error(ZeroDivisionError)
+ -> { 1.0.send(@method, 0) }.should.raise(ZeroDivisionError)
+ -> { 1.0.send(@method, 0.0) }.should.raise(ZeroDivisionError)
end
end
diff --git a/spec/ruby/core/float/shared/quo.rb b/spec/ruby/core/float/shared/quo.rb
index 0c90171b87..930187aaf7 100644
--- a/spec/ruby/core/float/shared/quo.rb
+++ b/spec/ruby/core/float/shared/quo.rb
@@ -12,8 +12,8 @@ describe :float_quo, shared: true do
end
it "returns NaN when the argument is NaN" do
- -1819.999999.send(@method, nan_value).nan?.should be_true
- 11109.1981271.send(@method, nan_value).nan?.should be_true
+ -1819.999999.send(@method, nan_value).nan?.should == true
+ 11109.1981271.send(@method, nan_value).nan?.should == true
end
it "returns Infinity when the argument is 0.0" do
@@ -50,10 +50,10 @@ describe :float_quo, shared: true do
end
it "raises a TypeError when argument isn't numeric" do
- -> { 27292.2.send(@method, mock('non-numeric')) }.should raise_error(TypeError)
+ -> { 27292.2.send(@method, mock('non-numeric')) }.should.raise(TypeError)
end
it "raises an ArgumentError when passed multiple arguments" do
- -> { 272.221.send(@method, 6,0.2) }.should raise_error(ArgumentError)
+ -> { 272.221.send(@method, 6,0.2) }.should.raise(ArgumentError)
end
end
diff --git a/spec/ruby/core/float/shared/to_i.rb b/spec/ruby/core/float/shared/to_i.rb
index 33b32ca533..1e6f941467 100644
--- a/spec/ruby/core/float/shared/to_i.rb
+++ b/spec/ruby/core/float/shared/to_i.rb
@@ -1,14 +1,14 @@
describe :float_to_i, shared: true do
it "returns self truncated to an Integer" do
- 899.2.send(@method).should eql(899)
- -1.122256e-45.send(@method).should eql(0)
- 5_213_451.9201.send(@method).should eql(5213451)
- 1.233450999123389e+12.send(@method).should eql(1233450999123)
- -9223372036854775808.1.send(@method).should eql(-9223372036854775808)
- 9223372036854775808.1.send(@method).should eql(9223372036854775808)
+ 899.2.send(@method).should.eql?(899)
+ -1.122256e-45.send(@method).should.eql?(0)
+ 5_213_451.9201.send(@method).should.eql?(5213451)
+ 1.233450999123389e+12.send(@method).should.eql?(1233450999123)
+ -9223372036854775808.1.send(@method).should.eql?(-9223372036854775808)
+ 9223372036854775808.1.send(@method).should.eql?(9223372036854775808)
end
it "raises a FloatDomainError for NaN" do
- -> { nan_value.send(@method) }.should raise_error(FloatDomainError)
+ -> { nan_value.send(@method) }.should.raise(FloatDomainError)
end
end
diff --git a/spec/ruby/core/float/shared/to_s.rb b/spec/ruby/core/float/shared/to_s.rb
index 0925efc0f7..81ffdd9e81 100644
--- a/spec/ruby/core/float/shared/to_s.rb
+++ b/spec/ruby/core/float/shared/to_s.rb
@@ -297,12 +297,12 @@ describe :float_to_s, shared: true do
it "returns a String in US-ASCII encoding when Encoding.default_internal is nil" do
Encoding.default_internal = nil
- 1.23.send(@method).encoding.should equal(Encoding::US_ASCII)
+ 1.23.send(@method).encoding.should.equal?(Encoding::US_ASCII)
end
it "returns a String in US-ASCII encoding when Encoding.default_internal is not nil" do
Encoding.default_internal = Encoding::IBM437
- 5.47.send(@method).encoding.should equal(Encoding::US_ASCII)
+ 5.47.send(@method).encoding.should.equal?(Encoding::US_ASCII)
end
end
end