Class: RSpec::Mocks::ArgumentMatchers::RegexpMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/mocks/argument_matchers.rb

Instance Method Summary (collapse)

Constructor Details

- (RegexpMatcher) initialize(regexp)

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

- (Object) ==(value)

40
41
42
# File 'lib/rspec/mocks/argument_matchers.rb', line 40
def ==(value)
  Regexp === value ? value == @regexp : value =~ @regexp
end