Class: Spec::Mocks::ArgumentMatchers::RegexpMatcher
- Defined in:
- lib/spec/mocks/argument_matchers.rb
Instance Method Summary collapse
- #==(value) ⇒ Object
-
#initialize(regexp) ⇒ RegexpMatcher
constructor
A new instance of RegexpMatcher.
Constructor Details
#initialize(regexp) ⇒ RegexpMatcher
Returns a new instance of RegexpMatcher.
38 39 40 |
# File 'lib/spec/mocks/argument_matchers.rb', line 38 def initialize(regexp) @regexp = regexp end |
Instance Method Details
#==(value) ⇒ Object
42 43 44 45 |
# File 'lib/spec/mocks/argument_matchers.rb', line 42 def ==(value) return value =~ @regexp unless value.is_a?(Regexp) value == @regexp end |