Class: Spec::Example::ExampleMatcherSpecHelper::MatchDescription

Inherits:
Object
  • Object
show all
Defined in:
lib/gems/rspec-1.1.11/spec/spec/example/example_matcher_spec.rb

Instance Method Summary collapse

Constructor Details

#initialize(description) ⇒ MatchDescription

Returns a new instance of MatchDescription.



7
8
9
# File 'lib/gems/rspec-1.1.11/spec/spec/example/example_matcher_spec.rb', line 7

def initialize(description)
  @description = description
end

Instance Method Details

#failure_messageObject



15
16
17
# File 'lib/gems/rspec-1.1.11/spec/spec/example/example_matcher_spec.rb', line 15

def failure_message
  "expected matcher.matches?(#{@description.inspect}) to return true, got false"
end

#matches?(matcher) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/gems/rspec-1.1.11/spec/spec/example/example_matcher_spec.rb', line 11

def matches?(matcher)
  matcher.matches?(@description)
end

#negative_failure_messageObject



19
20
21
# File 'lib/gems/rspec-1.1.11/spec/spec/example/example_matcher_spec.rb', line 19

def negative_failure_message
  "expected matcher.matches?(#{@description.inspect}) to return false, got true"
end