summaryrefslogtreecommitdiff
path: root/spec/mspec/spec/runner/filters/regexp_spec.rb
diff options
context:
space:
mode:
authoreregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 16:19:10 +0000
committereregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-03 16:19:10 +0000
commitaeeaadaad08038217440c1e9e7c5ca126d7dc633 (patch)
treef82997d5fc1e98f665b6327ced3125826f15c336 /spec/mspec/spec/runner/filters/regexp_spec.rb
parenta2c7d0cea999bc8f8e6deb89bcee5eb80ba13ea2 (diff)
Update to ruby/mspec@072849e
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64179 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/mspec/spec/runner/filters/regexp_spec.rb')
-rw-r--r--spec/mspec/spec/runner/filters/regexp_spec.rb20
1 files changed, 19 insertions, 1 deletions
diff --git a/spec/mspec/spec/runner/filters/regexp_spec.rb b/spec/mspec/spec/runner/filters/regexp_spec.rb
index 6c05b0f42f..8e9b0ec7e8 100644
--- a/spec/mspec/spec/runner/filters/regexp_spec.rb
+++ b/spec/mspec/spec/runner/filters/regexp_spec.rb
@@ -2,12 +2,30 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'mspec/runner/mspec'
require 'mspec/runner/filters/regexp'
+describe MatchFilter, "#===" do
+ before :each do
+ @filter = RegexpFilter.new nil, 'a(b|c)', 'b[^ab]', 'cc?'
+ end
+
+ it "returns true if the argument matches any of the #initialize strings" do
+ @filter.===('ab').should == true
+ @filter.===('bc suffix').should == true
+ @filter.===('prefix cc').should == true
+ end
+
+ it "returns false if the argument matches none of the #initialize strings" do
+ @filter.===('aa').should == false
+ @filter.===('ba').should == false
+ @filter.===('prefix d suffix').should == false
+ end
+end
+
describe RegexpFilter, "#to_regexp" do
before :each do
@filter = RegexpFilter.new nil
end
it "converts its arguments to Regexp instances" do
- @filter.to_regexp('a(b|c)', 'b[^ab]', 'cc?').should == [/a(b|c)/, /b[^ab]/, /cc?/]
+ @filter.send(:to_regexp, 'a(b|c)', 'b[^ab]', 'cc?').should == [/a(b|c)/, /b[^ab]/, /cc?/]
end
end