class TarkaMatchers::Matchers::Expectation::SupportBlockExpectations
Public Instance Methods
description()
click to toggle source
# File lib/tarka_matchers/matchers/expectation/support_block_expectations.rb, line 25 def description "utilize a matcher, '#{@actual_matcher.class}', that supports block expectations." end
failure_message()
click to toggle source
# File lib/tarka_matchers/matchers/expectation/support_block_expectations.rb, line 35 def failure_message "failed to #{description} #{report}" end
failure_message_when_negated()
click to toggle source
# File lib/tarka_matchers/matchers/expectation/support_block_expectations.rb, line 39 def failure_message_when_negated "#{description} #{report}" end
matches?(actual)
click to toggle source
# File lib/tarka_matchers/matchers/expectation/support_block_expectations.rb, line 14 def matches? actual @actual_matcher = TarkaMatchers::Helpers::Expectation::ExpectCapture.capture(actual)[1] @exist = true begin @actual = @actual_matcher.supports_block_expectations? rescue NoMethodError @exist = false end @actual == true end
report()
click to toggle source
# File lib/tarka_matchers/matchers/expectation/support_block_expectations.rb, line 29 def report message = "Expected the matcher, '#{@actual_matcher.class}', to contain the method supports_block_expectations? method and for it to return 'true'. " @exist ? message << "Instead it returned '#{@actual}'." : message << "The supports_block_expectations? method does not exist inside the matcher. (Hint: check spelling)" message end
supports_block_expectations?()
click to toggle source
# File lib/tarka_matchers/matchers/expectation/support_block_expectations.rb, line 10 def supports_block_expectations? true end