File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 5757 # NOTE: Added this case just to not forget about the decision in the ticket
5858 it "raise ArgumentError when a directive is unknown" do
5959 # additional directive ('a') is required for the X directive
60- -> { [ @obj , @obj ] . pack ( "a R" + pack_format ) } . should raise_error ( ArgumentError )
61- -> { [ @obj , @obj ] . pack ( "a 0" + pack_format ) } . should raise_error ( ArgumentError )
62- -> { [ @obj , @obj ] . pack ( "a :" + pack_format ) } . should raise_error ( ArgumentError )
60+ -> { [ @obj , @obj ] . pack ( "a R" + pack_format ) } . should raise_error ( ArgumentError , /unknown pack directive 'R'/ )
61+ -> { [ @obj , @obj ] . pack ( "a 0" + pack_format ) } . should raise_error ( ArgumentError , /unknown pack directive '0'/ )
62+ -> { [ @obj , @obj ] . pack ( "a :" + pack_format ) } . should raise_error ( ArgumentError , /unknown pack directive ':'/ )
6363 end
6464 end
6565
Original file line number Diff line number Diff line change 88 d . should_receive ( :to_str ) . and_return ( "a" +unpack_format )
99 "abc" . unpack ( d ) . should be_an_instance_of ( Array )
1010 end
11+
12+ ruby_version_is "3.3" do
13+ # https://bugs.ruby-lang.org/issues/19150
14+ it 'raise ArgumentError when a directive is unknown' do
15+ -> { "abcdefgh" . unpack ( "a R" + unpack_format ) } . should raise_error ( ArgumentError , /unknown unpack directive 'R'/ )
16+ -> { "abcdefgh" . unpack ( "a 0" + unpack_format ) } . should raise_error ( ArgumentError , /unknown unpack directive '0'/ )
17+ -> { "abcdefgh" . unpack ( "a :" + unpack_format ) } . should raise_error ( ArgumentError , /unknown unpack directive ':'/ )
18+ end
19+ end
1120end
1221
1322describe :string_unpack_no_platform , shared : true do
You can’t perform that action at this time.
0 commit comments