diff options
Diffstat (limited to 'spec/ruby/core/array/pack/x_spec.rb')
| -rw-r--r-- | spec/ruby/core/array/pack/x_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/ruby/core/array/pack/x_spec.rb b/spec/ruby/core/array/pack/x_spec.rb index 2662873d03..012fe4567f 100644 --- a/spec/ruby/core/array/pack/x_spec.rb +++ b/spec/ruby/core/array/pack/x_spec.rb @@ -1,4 +1,4 @@ -# -*- encoding: binary -*- +# encoding: binary require_relative '../../../spec_helper' require_relative '../fixtures/classes' require_relative 'shared/basic' @@ -30,6 +30,7 @@ describe "Array#pack with format 'x'" do it "does not add a NULL byte when passed the '*' modifier" do [].pack("x*").should == "" + [1, 2].pack("Cx*C").should == "\x01\x02" end end @@ -55,10 +56,10 @@ describe "Array#pack with format 'X'" do end it "raises an ArgumentError if the output string is empty" do - lambda { [1, 2, 3].pack("XC") }.should raise_error(ArgumentError) + -> { [1, 2, 3].pack("XC") }.should raise_error(ArgumentError) end it "raises an ArgumentError if the count modifier is greater than the bytes in the string" do - lambda { [1, 2, 3].pack("C2X3") }.should raise_error(ArgumentError) + -> { [1, 2, 3].pack("C2X3") }.should raise_error(ArgumentError) end end |
