File tree Expand file tree Collapse file tree 2 files changed +15
-12
lines changed
Expand file tree Collapse file tree 2 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 3333 end
3434
3535 ruby_version_is "" ..."3.3" do
36- # https://bugs.ruby-lang.org/issues/19150
37- # NOTE: it's just a plan of the Ruby core team
3836 it "warns that a directive is unknown" do
3937 # additional directive ('a') is required for the X directive
40- -> { [ @obj , @obj ] . pack ( "a R" + pack_format ) } . should complain ( /unknown pack directive 'R'/ )
41- -> { [ @obj , @obj ] . pack ( "a 0" + pack_format ) } . should complain ( /unknown pack directive '0'/ )
42- -> { [ @obj , @obj ] . pack ( "a :" + pack_format ) } . should complain ( /unknown pack directive ':'/ )
38+ -> { [ @obj , @obj ] . pack ( "a R" + pack_format ) } . should complain ( /unknown pack directive 'R' in 'a R #{ pack_format } ' / )
39+ -> { [ @obj , @obj ] . pack ( "a 0" + pack_format ) } . should complain ( /unknown pack directive '0' in 'a 0 #{ pack_format } ' / )
40+ -> { [ @obj , @obj ] . pack ( "a :" + pack_format ) } . should complain ( /unknown pack directive ':' in 'a : #{ pack_format } ' / )
4341 end
4442 end
4543
4644 ruby_version_is "3.3" do
47- # https://bugs.ruby-lang.org/issues/19150
48- # NOTE: Added this case just to not forget about the decision in the ticket
4945 it "raise ArgumentError when a directive is unknown" do
5046 # additional directive ('a') is required for the X directive
5147 -> { [ @obj , @obj ] . pack ( "a R" + pack_format ) } . should raise_error ( ArgumentError , /unknown pack directive 'R'/ )
Original file line number Diff line number Diff line change 99 "abc" . unpack ( d ) . should be_an_instance_of ( Array )
1010 end
1111
12+ ruby_version_is "" ..."3.3" do
13+ it "warns about using an unknown directive" do
14+ -> { "abcdefgh" . unpack ( "a R" + unpack_format ) } . should complain ( /unknown unpack directive 'R' in 'a R#{ unpack_format } '/ )
15+ -> { "abcdefgh" . unpack ( "a 0" + unpack_format ) } . should complain ( /unknown unpack directive '0' in 'a 0#{ unpack_format } '/ )
16+ -> { "abcdefgh" . unpack ( "a :" + unpack_format ) } . should complain ( /unknown unpack directive ':' in 'a :#{ unpack_format } '/ )
17+ end
18+ end
19+
1220 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 ':'/ )
21+ it "raises ArgumentError when a directive is unknown" do
22+ -> { "abcdefgh" . unpack ( "a R" + unpack_format ) } . should raise_error ( ArgumentError , "unknown unpack directive 'R' in 'a R#{ unpack_format } '" )
23+ -> { "abcdefgh" . unpack ( "a 0" + unpack_format ) } . should raise_error ( ArgumentError , "unknown unpack directive '0' in 'a 0#{ unpack_format } '" )
24+ -> { "abcdefgh" . unpack ( "a :" + unpack_format ) } . should raise_error ( ArgumentError , "unknown unpack directive ':' in 'a :#{ unpack_format } '" )
1825 end
1926 end
2027end
You can’t perform that action at this time.
0 commit comments