Class: RSpec::Matchers::DSL::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/serverspec.rb

Instance Method Summary collapse

Instance Method Details

#failure_message_for_should(&block) ⇒ Object



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/serverspec.rb', line 51

def failure_message_for_should(&block)
  if block.to_s =~ /serverspec\/matchers\/.+\.rb/
    @custom = true
  end
  if @custom
    cache_or_call_cached(:failure_message_for_should, &block)
  else
    message =  "#{example.[:command]}\n"
    message += "#{example.[:stdout]}"
    message
  end
end