summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared
diff options
context:
space:
mode:
authorBenoit Daloze <[email protected]>2020-05-03 12:28:29 +0200
committerBenoit Daloze <[email protected]>2020-05-03 12:28:29 +0200
commit5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 (patch)
treee1694f5a4a5558884b1b8f3890b186793e5e982f /spec/ruby/core/string/shared
parentf646d20aaeb8f02bcd3d0c5c3f5a372da654502a (diff)
Update to ruby/spec@032ee74
Diffstat (limited to 'spec/ruby/core/string/shared')
-rw-r--r--spec/ruby/core/string/shared/chars.rb4
-rw-r--r--spec/ruby/core/string/shared/concat.rb8
-rw-r--r--spec/ruby/core/string/shared/each_line.rb4
-rw-r--r--spec/ruby/core/string/shared/replace.rb8
-rw-r--r--spec/ruby/core/string/shared/slice.rb26
-rw-r--r--spec/ruby/core/string/shared/succ.rb2
-rw-r--r--spec/ruby/core/string/shared/to_s.rb4
-rw-r--r--spec/ruby/core/string/shared/to_sym.rb2
8 files changed, 29 insertions, 29 deletions
diff --git a/spec/ruby/core/string/shared/chars.rb b/spec/ruby/core/string/shared/chars.rb
index 9c7a4deb8b..1f045e4530 100644
--- a/spec/ruby/core/string/shared/chars.rb
+++ b/spec/ruby/core/string/shared/chars.rb
@@ -69,11 +69,11 @@ describe :string_chars, shared: true do
str = "hello"
str.send(@method) do |x|
- x.tainted?.should == false
+ x.should_not.tainted?
end
str.dup.taint.send(@method) do |x|
- x.tainted?.should == true
+ x.should.tainted?
end
end
end
diff --git a/spec/ruby/core/string/shared/concat.rb b/spec/ruby/core/string/shared/concat.rb
index d127b08e9c..d6ffad7d4d 100644
--- a/spec/ruby/core/string/shared/concat.rb
+++ b/spec/ruby/core/string/shared/concat.rb
@@ -41,13 +41,13 @@ describe :string_concat, shared: true do
ruby_version_is ''...'2.7' do
it "taints self if other is tainted" do
- "x".send(@method, "".taint).tainted?.should == true
- "x".send(@method, "y".taint).tainted?.should == true
+ "x".send(@method, "".taint).should.tainted?
+ "x".send(@method, "y".taint).should.tainted?
end
it "untrusts self if other is untrusted" do
- "x".send(@method, "".untrust).untrusted?.should == true
- "x".send(@method, "y".untrust).untrusted?.should == true
+ "x".send(@method, "".untrust).should.untrusted?
+ "x".send(@method, "y".untrust).should.untrusted?
end
end
diff --git a/spec/ruby/core/string/shared/each_line.rb b/spec/ruby/core/string/shared/each_line.rb
index c82e63cfe8..156565ff13 100644
--- a/spec/ruby/core/string/shared/each_line.rb
+++ b/spec/ruby/core/string/shared/each_line.rb
@@ -42,9 +42,9 @@ describe :string_each_line, shared: true do
ruby_version_is ''...'2.7' do
it "taints substrings that are passed to the block if self is tainted" do
- "one\ntwo\r\nthree".taint.send(@method) { |s| s.tainted?.should == true }
+ "one\ntwo\r\nthree".taint.send(@method) { |s| s.should.tainted? }
- "x.y.".send(@method, ".".taint) { |s| s.tainted?.should == false }
+ "x.y.".send(@method, ".".taint) { |s| s.should_not.tainted? }
end
end
diff --git a/spec/ruby/core/string/shared/replace.rb b/spec/ruby/core/string/shared/replace.rb
index 3c5a15e12d..8dfac49f02 100644
--- a/spec/ruby/core/string/shared/replace.rb
+++ b/spec/ruby/core/string/shared/replace.rb
@@ -15,28 +15,28 @@ describe :string_replace, shared: true do
a = ""
b = "".taint
a.send(@method, b)
- a.tainted?.should == true
+ a.should.tainted?
end
it "does not untaint self if other is untainted" do
a = "".taint
b = ""
a.send(@method, b)
- a.tainted?.should == true
+ a.should.tainted?
end
it "untrusts self if other is untrusted" do
a = ""
b = "".untrust
a.send(@method, b)
- a.untrusted?.should == true
+ a.should.untrusted?
end
it "does not trust self if other is trusted" do
a = "".untrust
b = ""
a.send(@method, b)
- a.untrusted?.should == true
+ a.should.untrusted?
end
end
diff --git a/spec/ruby/core/string/shared/slice.rb b/spec/ruby/core/string/shared/slice.rb
index 1c438bc48d..6b6f37217a 100644
--- a/spec/ruby/core/string/shared/slice.rb
+++ b/spec/ruby/core/string/shared/slice.rb
@@ -85,9 +85,9 @@ describe :string_slice_index_length, shared: true do
str = "hello world"
str.taint
- str.send(@method, 0,0).tainted?.should == true
- str.send(@method, 0,1).tainted?.should == true
- str.send(@method, 2,1).tainted?.should == true
+ str.send(@method, 0,0).should.tainted?
+ str.send(@method, 0,1).should.tainted?
+ str.send(@method, 2,1).should.tainted?
end
end
@@ -243,12 +243,12 @@ describe :string_slice_range, shared: true do
str = "hello world"
str.taint
- str.send(@method, 0..0).tainted?.should == true
- str.send(@method, 0...0).tainted?.should == true
- str.send(@method, 0..1).tainted?.should == true
- str.send(@method, 0...1).tainted?.should == true
- str.send(@method, 2..3).tainted?.should == true
- str.send(@method, 2..0).tainted?.should == true
+ str.send(@method, 0..0).should.tainted?
+ str.send(@method, 0...0).should.tainted?
+ str.send(@method, 0..1).should.tainted?
+ str.send(@method, 0...1).should.tainted?
+ str.send(@method, 2..3).should.tainted?
+ str.send(@method, 2..0).should.tainted?
end
end
@@ -338,7 +338,7 @@ describe :string_slice_regexp, shared: true do
tainted_re = /./
tainted_re.taint
- str.send(@method, tainted_re).tainted?.should == true
+ str.send(@method, tainted_re).should.tainted?
end
end
@@ -395,9 +395,9 @@ describe :string_slice_regexp_index, shared: true do
tainted_re = /(.)(.)(.)/
tainted_re.taint
- str.send(@method, tainted_re, 0).tainted?.should == true
- str.send(@method, tainted_re, 1).tainted?.should == true
- str.send(@method, tainted_re, -1).tainted?.should == true
+ str.send(@method, tainted_re, 0).should.tainted?
+ str.send(@method, tainted_re, 1).should.tainted?
+ str.send(@method, tainted_re, -1).should.tainted?
end
end
diff --git a/spec/ruby/core/string/shared/succ.rb b/spec/ruby/core/string/shared/succ.rb
index 346ccee409..7ca488dd88 100644
--- a/spec/ruby/core/string/shared/succ.rb
+++ b/spec/ruby/core/string/shared/succ.rb
@@ -68,7 +68,7 @@ describe :string_succ, shared: true do
ruby_version_is ''...'2.7' do
it "taints the result if self is tainted" do
["", "a", "z", "Z", "9", "\xFF", "\xFF\xFF"].each do |s|
- s.taint.send(@method).tainted?.should == true
+ s.taint.send(@method).should.tainted?
end
end
end
diff --git a/spec/ruby/core/string/shared/to_s.rb b/spec/ruby/core/string/shared/to_s.rb
index 36283be4d0..b8c9b8ab44 100644
--- a/spec/ruby/core/string/shared/to_s.rb
+++ b/spec/ruby/core/string/shared/to_s.rb
@@ -13,8 +13,8 @@ describe :string_to_s, shared: true do
ruby_version_is ''...'2.7' do
it "taints the result when self is tainted" do
- "x".taint.send(@method).tainted?.should == true
- StringSpecs::MyString.new("x").taint.send(@method).tainted?.should == true
+ "x".taint.send(@method).should.tainted?
+ StringSpecs::MyString.new("x").taint.send(@method).should.tainted?
end
end
end
diff --git a/spec/ruby/core/string/shared/to_sym.rb b/spec/ruby/core/string/shared/to_sym.rb
index 1180d64712..416f302aef 100644
--- a/spec/ruby/core/string/shared/to_sym.rb
+++ b/spec/ruby/core/string/shared/to_sym.rb
@@ -55,7 +55,7 @@ describe :string_to_sym, shared: true do
it "raises an EncodingError for UTF-8 String containing invalid bytes" do
invalid_utf8 = "\xC3"
- invalid_utf8.valid_encoding?.should == false
+ invalid_utf8.should_not.valid_encoding?
-> {
invalid_utf8.send(@method)
}.should raise_error(EncodingError, /invalid/)