spec/hexdump_spec.rb in hexdump-0.2.3 vs spec/hexdump_spec.rb in hexdump-0.2.4
- old
+ new
@@ -8,12 +8,14 @@
let(:hex_chars) { ['68', '65', '6c', '6c', '6f'] }
subject do
obj = Object.new.extend(Hexdump)
- stub = obj.stub!(:each_byte)
- bytes.each { |b| stub = stub.and_yield(b) }
+ each_byte = expect(obj).to receive(:each_byte)
+ bytes.each do |b|
+ each_byte = each_byte.and_yield(b)
+ end
obj
end
it "should hexdump the object" do
@@ -21,9 +23,9 @@
subject.hexdump do |index,hex,print|
chars += hex
end
- chars.should == hex_chars
+ expect(chars).to be == hex_chars
end
end
end