diff options
Diffstat (limited to 'spec/ruby/core/array/pack/w_spec.rb')
-rw-r--r-- | spec/ruby/core/array/pack/w_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/ruby/core/array/pack/w_spec.rb b/spec/ruby/core/array/pack/w_spec.rb index 439fa02198..e241d1519c 100644 --- a/spec/ruby/core/array/pack/w_spec.rb +++ b/spec/ruby/core/array/pack/w_spec.rb @@ -24,8 +24,18 @@ describe "Array#pack with format 'w'" do [obj].pack("w").should == "\x05" end - it "ignores NULL bytes between directives" do - [1, 2, 3].pack("w\x00w").should == "\x01\x02" + ruby_version_is ""..."3.3" do + it "ignores NULL bytes between directives" do + [1, 2, 3].pack("w\x00w").should == "\x01\x02" + end + end + + ruby_version_is "3.3" do + it "raise ArgumentError for NULL bytes between directives" do + -> { + [1, 2, 3].pack("w\x00w") + }.should raise_error(ArgumentError, /unknown pack directive/) + end end it "ignores spaces between directives" do |