summaryrefslogtreecommitdiff
path: root/spec/ruby/core/regexp/match_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/regexp/match_spec.rb')
-rw-r--r--spec/ruby/core/regexp/match_spec.rb40
1 files changed, 19 insertions, 21 deletions
diff --git a/spec/ruby/core/regexp/match_spec.rb b/spec/ruby/core/regexp/match_spec.rb
index edac0d1d42..45ed4a5932 100644
--- a/spec/ruby/core/regexp/match_spec.rb
+++ b/spec/ruby/core/regexp/match_spec.rb
@@ -111,32 +111,30 @@ describe "Regexp#match" do
end
end
-ruby_version_is "2.4" do
- describe "Regexp#match?" do
- before :each do
- # Resetting Regexp.last_match
- /DONTMATCH/.match ''
- end
+describe "Regexp#match?" do
+ before :each do
+ # Resetting Regexp.last_match
+ /DONTMATCH/.match ''
+ end
- context "when matches the given value" do
- it "returns true but does not set Regexp.last_match" do
- /string/i.match?('string').should be_true
- Regexp.last_match.should be_nil
- end
+ context "when matches the given value" do
+ it "returns true but does not set Regexp.last_match" do
+ /string/i.match?('string').should be_true
+ Regexp.last_match.should be_nil
end
+ end
- it "returns false when does not match the given value" do
- /STRING/.match?('string').should be_false
- end
+ it "returns false when does not match the given value" do
+ /STRING/.match?('string').should be_false
+ end
- it "takes matching position as the 2nd argument" do
- /str/i.match?('string', 0).should be_true
- /str/i.match?('string', 1).should be_false
- end
+ it "takes matching position as the 2nd argument" do
+ /str/i.match?('string', 0).should be_true
+ /str/i.match?('string', 1).should be_false
+ end
- it "returns false when given nil" do
- /./.match?(nil).should be_false
- end
+ it "returns false when given nil" do
+ /./.match?(nil).should be_false
end
end