diff options
Diffstat (limited to 'spec/ruby/core/string/unpack/w_spec.rb')
| -rw-r--r-- | spec/ruby/core/string/unpack/w_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/ruby/core/string/unpack/w_spec.rb b/spec/ruby/core/string/unpack/w_spec.rb index 011c75f5c4..cc9aecac9c 100644 --- a/spec/ruby/core/string/unpack/w_spec.rb +++ b/spec/ruby/core/string/unpack/w_spec.rb @@ -1,4 +1,4 @@ -# -*- encoding: binary -*- +# encoding: binary require_relative '../../../spec_helper' require_relative '../fixtures/classes' require_relative 'shared/basic' @@ -15,8 +15,10 @@ describe "String#unpack with directive 'w'" do ].should be_computed_by(:unpack, "w") end - it "ignores NULL bytes between directives" do - "\x01\x02\x03".unpack("w\x00w").should == [1, 2] + it "raise ArgumentError for NULL bytes between directives" do + -> { + "\x01\x02\x03".unpack("w\x00w") + }.should.raise(ArgumentError, /unknown unpack directive/) end it "ignores spaces between directives" do |
