spec/formatting/binary/float_spec.rb in ronin-support-0.5.1 vs spec/formatting/binary/float_spec.rb in ronin-support-0.5.2
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: US-ASCII
+
require 'spec_helper'
require 'ronin/formatting/extensions/binary/float'
describe Float do
subject { 0.42 }
@@ -11,24 +13,24 @@
describe "#pack" do
let(:packed) { "\xE1z\x14\xAEG\xE1\xDA?" }
context "when only given a String" do
it "should unpack Strings using String#unpack template Strings" do
- subject.pack('E').should == packed
+ expect(subject.pack('E')).to eq(packed)
end
end
context "when given a Binary::Template Float type" do
it "should unpack Strings using Binary::Template" do
- subject.pack(:double_le).should == packed
+ expect(subject.pack(:double_le)).to eq(packed)
end
end
context "when given non-Float Binary::Template types" do
it "should raise an ArgumentError" do
- lambda {
+ expect {
subject.pack(:int)
- }.should raise_error(ArgumentError)
+ }.to raise_error(ArgumentError)
end
end
end
end