Class: TarkaMatchers::Matchers::Expectation::Fail

Inherits:
Object
  • Object
show all
Defined in:
lib/tarka_matchers/matchers/expectation/fail.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



17
18
19
# File 'lib/tarka_matchers/matchers/expectation/fail.rb', line 17

def description 
  "fail."
end

#failure_messageObject



25
26
27
# File 'lib/tarka_matchers/matchers/expectation/fail.rb', line 25

def failure_message
  "#{description} #{report}"
end

#failure_message_when_negatedObject



29
30
31
# File 'lib/tarka_matchers/matchers/expectation/fail.rb', line 29

def failure_message_when_negated
  "#{description} #{report}"
end

#matches?(expectation) ⇒ Boolean

Returns:

  • (Boolean)


12
13
14
15
# File 'lib/tarka_matchers/matchers/expectation/fail.rb', line 12

def matches? expectation
  @actual = TarkaMatchers::Helpers::Expectation::Result.pass?{ expectation.call }
  @actual != true
end

#reportObject



21
22
23
# File 'lib/tarka_matchers/matchers/expectation/fail.rb', line 21

def report
  "Spec result: #{@actual}"
end

#supports_block_expectations?Boolean

Returns:

  • (Boolean)


10
# File 'lib/tarka_matchers/matchers/expectation/fail.rb', line 10

def supports_block_expectations?; true; end