spec/float_spec.rb in bindata-1.4.3 vs spec/float_spec.rb in bindata-1.4.4

- old
+ new

@@ -4,34 +4,34 @@ require 'bindata/float' describe "A FloatLe" do subject { BinData::FloatLe.new(Math::PI) } - its(:num_bytes) { should == 4 } - its(:to_binary_s) { should == [Math::PI].pack('e') } - its(:value_read_from_written) { should be_close(Math::PI, 0.000001) } + its(:num_bytes) { should == 4 } + its(:to_binary_s) { should == [Math::PI].pack('e') } + its(:value_read_from_written) { should be_within(0.000001).of(Math::PI) } end describe "A FloatBe" do subject { BinData::FloatBe.new(Math::PI) } - its(:num_bytes) { should == 4 } - its(:to_binary_s) { should == [Math::PI].pack('g') } - its(:value_read_from_written) { should be_close(Math::PI, 0.000001) } + its(:num_bytes) { should == 4 } + its(:to_binary_s) { should == [Math::PI].pack('g') } + its(:value_read_from_written) { should be_within(0.000001).of(Math::PI) } end describe "A DoubleLe" do subject { BinData::DoubleLe.new(Math::PI) } - its(:num_bytes) { should == 8 } - its(:to_binary_s) { should == [Math::PI].pack('E') } - its(:value_read_from_written) { should be_close(Math::PI, 0.0000000000000001) } + its(:num_bytes) { should == 8 } + its(:to_binary_s) { should == [Math::PI].pack('E') } + its(:value_read_from_written) { should be_within(0.0000000000000001).of(Math::PI) } end describe "A DoubleBe" do subject { BinData::DoubleBe.new(Math::PI) } - its(:num_bytes) { should == 8 } - its(:to_binary_s) { should == [Math::PI].pack('G') } - its(:value_read_from_written) { should be_close(Math::PI, 0.0000000000000001) } + its(:num_bytes) { should == 8 } + its(:to_binary_s) { should == [Math::PI].pack('G') } + its(:value_read_from_written) { should be_within(0.0000000000000001).of(Math::PI) } end