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.
36 37 38 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 36 def initialize(regexp) @regexp = regexp end |
Instance Method Details
#==(value) ⇒ Object
40 41 42 |
# File 'lib/rspec/mocks/argument_matchers.rb', line 40 def ==(value) Regexp === value ? value == @regexp : value =~ @regexp end |