diff options
author | Benoit Daloze <[email protected]> | 2019-04-27 18:53:23 +0200 |
---|---|---|
committer | Benoit Daloze <[email protected]> | 2019-04-27 18:53:23 +0200 |
commit | a1b4816759418ca8fe510e8739622fc5d77ab0f0 (patch) | |
tree | 9d4fb6091d0086817f5bde46bf1150e9130d34fd /spec/ruby/core/regexp | |
parent | 00c33d9c232ed1a79eda17acd7231ac93caa162b (diff) |
Update to ruby/spec@15c9619
Diffstat (limited to 'spec/ruby/core/regexp')
-rw-r--r-- | spec/ruby/core/regexp/match_spec.rb | 40 |
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 |