From d6fbde9cf08aa8ee625a2fd1fb46f495471c4932 Mon Sep 17 00:00:00 2001 From: Kevin Olbrich Date: Sun, 24 Sep 2023 20:55:25 -0400 Subject: [PATCH] tweak some tests --- spec/ruby_units/unit_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/ruby_units/unit_spec.rb b/spec/ruby_units/unit_spec.rb index 50fd348..b90f019 100644 --- a/spec/ruby_units/unit_spec.rb +++ b/spec/ruby_units/unit_spec.rb @@ -1680,15 +1680,15 @@ # see #203 context 'when the unit scalar is an Integer' do it 'the conversion is done accurately' do - expect(RubyUnits::Unit.new('1610610000 bytes').convert_to('GiB').scalar).to eql 100663125/67108864r + expect(RubyUnits::Unit.new('1610610000 bytes').convert_to('GiB').scalar).to be === 100663125/67108864r end it 'the converted unit has an Integer scalar if the initial unit has an Integer scalar and the scalar is equivalent to an integer' do - expect(RubyUnits::Unit.new('2 m').convert_to('mm').scalar).to eql 2000 + expect(RubyUnits::Unit.new('2 m').convert_to('mm').scalar).to be === 2000 end it 'the scalar becomes a Rational when necessary to preserve accuracy' do - expect(RubyUnits::Unit.new(2, 'm').convert_to('ft').scalar).to eql 2500/381r + expect(RubyUnits::Unit.new(2, 'm').convert_to('ft').scalar).to be === 2500/381r end end @@ -1698,7 +1698,7 @@ # even though the result is numerically equivalent to an Integer, we leave # it alone it 'preserves the scalar type' do - expect(unit.convert_to('mm').scalar).to be 2000.0 + expect(unit.convert_to('mm').scalar).to be === 2000.0 end end @@ -1706,7 +1706,7 @@ subject(:unit) { RubyUnits::Unit.new(2.0 + 1.0i, 'm') } it 'preserves the scalar type' do - expect(unit.convert_to('mm').scalar).to eql 2000.0 + 1000.0i + expect(unit.convert_to('mm').scalar).to be === 2000.0 + 1000.0i end end @@ -1714,7 +1714,7 @@ subject(:unit) { RubyUnits::Unit.new(2r, 'm') } it 'preserves the scalar type' do - expect(unit.convert_to('mm').scalar).to eql 2000r + expect(unit.convert_to('mm').scalar).to be === 2000r end end