aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/string/match_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-04-27 18:53:23 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-04-27 18:53:23 +0200
commita1b4816759418ca8fe510e8739622fc5d77ab0f0 (patch)
tree9d4fb6091d0086817f5bde46bf1150e9130d34fd /spec/ruby/core/string/match_spec.rb
parent00c33d9c232ed1a79eda17acd7231ac93caa162b (diff)
downloadruby-a1b4816759418ca8fe510e8739622fc5d77ab0f0.tar.gz
Update to ruby/spec@15c9619
Diffstat (limited to 'spec/ruby/core/string/match_spec.rb')
-rw-r--r--spec/ruby/core/string/match_spec.rb34
1 files changed, 16 insertions, 18 deletions
diff --git a/spec/ruby/core/string/match_spec.rb b/spec/ruby/core/string/match_spec.rb
index 7f3d9ebae5..67e015f23d 100644
--- a/spec/ruby/core/string/match_spec.rb
+++ b/spec/ruby/core/string/match_spec.rb
@@ -149,27 +149,25 @@ describe "String#match" do
end
end
-ruby_version_is "2.4" do
- describe "String#match?" do
- before :each do
- # Resetting Regexp.last_match
- /DONTMATCH/.match ''
- end
+describe "String#match?" do
+ before :each do
+ # Resetting Regexp.last_match
+ /DONTMATCH/.match ''
+ end
- context "when matches the given regex" do
- it "returns true but does not set Regexp.last_match" do
- 'string'.match?(/string/i).should be_true
- Regexp.last_match.should be_nil
- end
+ context "when matches the given regex" do
+ it "returns true but does not set Regexp.last_match" do
+ 'string'.match?(/string/i).should be_true
+ Regexp.last_match.should be_nil
end
+ end
- it "returns false when does not match the given regex" do
- 'string'.match?(/STRING/).should be_false
- end
+ it "returns false when does not match the given regex" do
+ 'string'.match?(/STRING/).should be_false
+ end
- it "takes matching position as the 2nd argument" do
- 'string'.match?(/str/i, 0).should be_true
- 'string'.match?(/str/i, 1).should be_false
- end
+ it "takes matching position as the 2nd argument" do
+ 'string'.match?(/str/i, 0).should be_true
+ 'string'.match?(/str/i, 1).should be_false
end
end