Class: RSpec::Mocks::ArgumentMatchers::RegexpMatcher
- Inherits:
-
Object
- Object
- RSpec::Mocks::ArgumentMatchers::RegexpMatcher
- Defined in:
- lib/rspec/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.
34 35 36 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 34 def initialize(regexp) @regexp = regexp end |
Instance Method Details
#==(value) ⇒ Object
38 39 40 41 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 38 def ==(value) return value =~ @regexp unless value.is_a?(Regexp) value == @regexp end |