summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2019-10-31 16:50:00 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2019-10-31 16:50:00 +0900
commit473882e01f7e55753733e2607ace633b5041f11f (patch)
tree10d7bd858b7f30bf1c972e178de21391f2de1261 /spec/ruby/library/stringio
parentebc884461b0d8c3144c05abeb793e381903de6b2 (diff)
Skip tainted examples for stringio
Diffstat (limited to 'spec/ruby/library/stringio')
-rw-r--r--spec/ruby/library/stringio/append_spec.rb8
-rw-r--r--spec/ruby/library/stringio/reopen_spec.rb20
-rw-r--r--spec/ruby/library/stringio/shared/write.rb8
3 files changed, 22 insertions, 14 deletions
diff --git a/spec/ruby/library/stringio/append_spec.rb b/spec/ruby/library/stringio/append_spec.rb
index a8bc6aabdb..034ca96aff 100644
--- a/spec/ruby/library/stringio/append_spec.rb
+++ b/spec/ruby/library/stringio/append_spec.rb
@@ -29,9 +29,11 @@ describe "StringIO#<< when passed [Object]" do
@io.string.should == "example\000\000\000\000\000\000\000\000just testing"
end
- it "taints self's String when the passed argument is tainted" do
- (@io << "test".taint)
- @io.string.tainted?.should be_true
+ ruby_version_is ""..."2.7"
+ it "taints self's String when the passed argument is tainted" do
+ (@io << "test".taint)
+ @io.string.tainted?.should be_true
+ end
end
it "does not taint self when the passed argument is tainted" do
diff --git a/spec/ruby/library/stringio/reopen_spec.rb b/spec/ruby/library/stringio/reopen_spec.rb
index 6b5bdb57a1..32bf13dd6d 100644
--- a/spec/ruby/library/stringio/reopen_spec.rb
+++ b/spec/ruby/library/stringio/reopen_spec.rb
@@ -202,9 +202,11 @@ describe "StringIO#reopen when passed [Object]" do
end
# NOTE: WEIRD!
- it "taints self when the passed Object was tainted" do
- @io.reopen(StringIO.new("reopened").taint)
- @io.tainted?.should be_true
+ ruby_version_is ""..."2.7"
+ it "taints self when the passed Object was tainted" do
+ @io.reopen(StringIO.new("reopened").taint)
+ @io.tainted?.should be_true
+ end
end
end
@@ -270,11 +272,13 @@ describe "StringIO#reopen" do
str.should == ''
end
- it "taints self if the provided StringIO argument is tainted" do
- new_io = StringIO.new("tainted")
- new_io.taint
- @io.reopen(new_io)
- @io.tainted?.should == true
+ ruby_version_is ""..."2.7"
+ it "taints self if the provided StringIO argument is tainted" do
+ new_io = StringIO.new("tainted")
+ new_io.taint
+ @io.reopen(new_io)
+ @io.tainted?.should == true
+ end
end
it "does not truncate the content even when the StringIO argument is in the truncate mode" do
diff --git a/spec/ruby/library/stringio/shared/write.rb b/spec/ruby/library/stringio/shared/write.rb
index df4822cc16..12c58d10da 100644
--- a/spec/ruby/library/stringio/shared/write.rb
+++ b/spec/ruby/library/stringio/shared/write.rb
@@ -45,9 +45,11 @@ describe :stringio_write_string, shared: true do
@io.pos.should eql(4)
end
- it "taints self's String when the passed argument is tainted" do
- @io.send(@method, "test".taint)
- @io.string.tainted?.should be_true
+ ruby_version_is ""..."2.7"
+ it "taints self's String when the passed argument is tainted" do
+ @io.send(@method, "test".taint)
+ @io.string.tainted?.should be_true
+ end
end
it "does not taint self when the passed argument is tainted" do