From a1b4816759418ca8fe510e8739622fc5d77ab0f0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 27 Apr 2019 18:53:23 +0200 Subject: Update to ruby/spec@15c9619 --- spec/ruby/core/string/match_spec.rb | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'spec/ruby/core/string/match_spec.rb') 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 -- cgit v1.2.3