summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/unpack/b_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/unpack/b_spec.rb')
-rw-r--r--spec/ruby/core/string/unpack/b_spec.rb38
1 files changed, 9 insertions, 29 deletions
diff --git a/spec/ruby/core/string/unpack/b_spec.rb b/spec/ruby/core/string/unpack/b_spec.rb
index 23d93a8aea..fac6ef5151 100644
--- a/spec/ruby/core/string/unpack/b_spec.rb
+++ b/spec/ruby/core/string/unpack/b_spec.rb
@@ -1,4 +1,4 @@
-# -*- encoding: binary -*-
+# encoding: binary
require_relative '../../../spec_helper'
require_relative '../fixtures/classes'
require_relative 'shared/basic'
@@ -86,20 +86,10 @@ describe "String#unpack with format 'B'" do
].should be_computed_by(:unpack, "BBB")
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- "\x80\x00".unpack("B\x00B").should == ["1", "0"]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "\x80\x00".unpack("B\x00B")
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "\x80\x00".unpack("B\x00B")
+ }.should.raise(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do
@@ -194,20 +184,10 @@ describe "String#unpack with format 'b'" do
].should be_computed_by(:unpack, "bbb")
end
- ruby_version_is ""..."3.3" do
- it "ignores NULL bytes between directives" do
- suppress_warning do
- "\x01\x00".unpack("b\x00b").should == ["1", "0"]
- end
- end
- end
-
- ruby_version_is "3.3" do
- it "raise ArgumentError for NULL bytes between directives" do
- -> {
- "\x01\x00".unpack("b\x00b")
- }.should raise_error(ArgumentError, /unknown unpack directive/)
- end
+ it "raise ArgumentError for NULL bytes between directives" do
+ -> {
+ "\x01\x00".unpack("b\x00b")
+ }.should.raise(ArgumentError, /unknown unpack directive/)
end
it "ignores spaces between directives" do