diff options
Diffstat (limited to 'spec/ruby/library/stringscanner/shared')
5 files changed, 1 insertions, 56 deletions
diff --git a/spec/ruby/library/stringscanner/shared/concat.rb b/spec/ruby/library/stringscanner/shared/concat.rb index cb884a5c01..1dbae11f7c 100644 --- a/spec/ruby/library/stringscanner/shared/concat.rb +++ b/spec/ruby/library/stringscanner/shared/concat.rb @@ -1,6 +1,6 @@ describe :strscan_concat, shared: true do it "concatenates the given argument to self and returns self" do - s = StringScanner.new("hello ") + s = StringScanner.new(+"hello ") s.send(@method, 'world').should == s s.string.should == "hello world" s.eos?.should be_false diff --git a/spec/ruby/library/stringscanner/shared/extract_range.rb b/spec/ruby/library/stringscanner/shared/extract_range.rb index 1c14f716c9..e7404fd0cb 100644 --- a/spec/ruby/library/stringscanner/shared/extract_range.rb +++ b/spec/ruby/library/stringscanner/shared/extract_range.rb @@ -8,17 +8,4 @@ describe :extract_range, shared: true do ch.should_not be_kind_of(cls) ch.should be_an_instance_of(String) end - - ruby_version_is ''...'2.7' do - it "taints the returned String if the input was tainted" do - str = 'abc' - str.taint - - s = StringScanner.new(str) - - s.send(@method).tainted?.should be_true - s.send(@method).tainted?.should be_true - s.send(@method).tainted?.should be_true - end - end end diff --git a/spec/ruby/library/stringscanner/shared/extract_range_matched.rb b/spec/ruby/library/stringscanner/shared/extract_range_matched.rb index 5c536f5c01..070a132812 100644 --- a/spec/ruby/library/stringscanner/shared/extract_range_matched.rb +++ b/spec/ruby/library/stringscanner/shared/extract_range_matched.rb @@ -10,15 +10,4 @@ describe :extract_range_matched, shared: true do ch.should_not be_kind_of(cls) ch.should be_an_instance_of(String) end - - ruby_version_is ''...'2.7' do - it "taints the returned String if the input was tainted" do - str = 'abc' - str.taint - - s = StringScanner.new(str) - s.scan(/\w{1}/) - s.send(@method).tainted?.should be_true - end - end end diff --git a/spec/ruby/library/stringscanner/shared/matched_size.rb b/spec/ruby/library/stringscanner/shared/matched_size.rb deleted file mode 100644 index 92174733f7..0000000000 --- a/spec/ruby/library/stringscanner/shared/matched_size.rb +++ /dev/null @@ -1,21 +0,0 @@ -describe :strscan_matched_size, shared: true do - before :each do - @s = StringScanner.new("This is a test") - end - - it "returns the size of the most recent match" do - @s.check(/This/) - @s.send(@method).should == 4 - @s.send(@method).should == 4 - @s.scan(//) - @s.send(@method).should == 0 - end - - it "returns nil if there was no recent match" do - @s.send(@method).should == nil - @s.check(/\d+/) - @s.send(@method).should == nil - @s.terminate - @s.send(@method).should == nil - end -end diff --git a/spec/ruby/library/stringscanner/shared/peek.rb b/spec/ruby/library/stringscanner/shared/peek.rb index 4e2e643353..4c757866c1 100644 --- a/spec/ruby/library/stringscanner/shared/peek.rb +++ b/spec/ruby/library/stringscanner/shared/peek.rb @@ -36,14 +36,4 @@ describe :strscan_peek, shared: true do ch.should_not be_kind_of(cls) ch.should be_an_instance_of(String) end - - ruby_version_is ''...'2.7' do - it "taints the returned String if the input was tainted" do - str = 'abc' - str.taint - - s = StringScanner.new(str) - s.send(@method, 1).tainted?.should be_true - end - end end |