From de5df203bcfb228b7043ae0116535953c325ddb4 Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Mon, 9 Dec 2024 20:32:39 +0200 Subject: Update to ruby/spec@9f10222 --- spec/ruby/core/string/unpack/shared/basic.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/ruby/core/string/unpack/shared/basic.rb') diff --git a/spec/ruby/core/string/unpack/shared/basic.rb b/spec/ruby/core/string/unpack/shared/basic.rb index bb5302edc5..b37a447683 100644 --- a/spec/ruby/core/string/unpack/shared/basic.rb +++ b/spec/ruby/core/string/unpack/shared/basic.rb @@ -8,6 +8,15 @@ describe :string_unpack_basic, shared: true do d.should_receive(:to_str).and_return("a"+unpack_format) "abc".unpack(d).should be_an_instance_of(Array) end + + ruby_version_is "3.3" do + # https://bugs.ruby-lang.org/issues/19150 + it 'raise ArgumentError when a directive is unknown' do + -> { "abcdefgh".unpack("a R" + unpack_format) }.should raise_error(ArgumentError, /unknown unpack directive 'R'/) + -> { "abcdefgh".unpack("a 0" + unpack_format) }.should raise_error(ArgumentError, /unknown unpack directive '0'/) + -> { "abcdefgh".unpack("a :" + unpack_format) }.should raise_error(ArgumentError, /unknown unpack directive ':'/) + end + end end describe :string_unpack_no_platform, shared: true do -- cgit v1.2.3