spec/string_spec.rb in bindata-1.4.1 vs spec/string_spec.rb in bindata-1.4.2
- old
+ new
@@ -34,9 +34,21 @@
small.assign(large)
small.should == "BBB"
end
end
+describe BinData::String do
+ subject { BinData::String.new("testing") }
+
+ it "should compare with regexp" do
+ (/es/ =~ subject).should == 1
+ end
+
+ it "should compare with regexp" do
+ (subject =~ /es/).should == 1
+ end
+end
+
describe BinData::String, "with :read_length" do
subject { BinData::String.new(:read_length => 5) }
its(:num_bytes) { should == 0 }
its(:value) { should == "" }