diff --git a/lib/serverspec.rb b/lib/serverspec.rb index a29d2acb..440a995a 100644 --- a/lib/serverspec.rb +++ b/lib/serverspec.rb @@ -13,9 +13,10 @@ module RSpec::Core::Notifications class FailedExampleNotification < ExampleNotification def failure_lines + host = ENV['TARGET_HOST'] || Specinfra.configuration.host @failure_lines ||= begin - lines = ["On host `#{Specinfra.configuration.host}`"] + lines = ["On host `#{host}`"] lines << "Failure/Error: #{read_failed_line.strip}" lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/ exception.message.to_s.split("\n").each do |line|