Sha256: 2facef1637b12654653debdca76cb6f6af080710e301e0b7d60cc8336d17ad82

Contents?: true

Size: 1.16 KB

Versions: 5

Compression:

Stored size: 1.16 KB

Contents

require 'rubygems'
require 'rspec'
require 'rspec/its'
require 'specinfra'
require 'serverspec/version'
require 'serverspec/matchers'
require 'serverspec/helper'
require 'serverspec/setup'
require 'serverspec/subject'
require 'serverspec/commands/base'
require 'rspec/core/formatters/base_formatter'

module RSpec::Core::Notifications
  class FailedExampleNotification < ExampleNotification
    def message_lines
      @lines ||=
        begin
          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|
          lines << "  #{line}" if exception.message
          lines << "  #{example.metadata[:command]}"
          lines << "  #{example.metadata[:stdout]}" if example.metadata[:stdout]
          lines << "  #{example.metadata[:stderr]}" if example.metadata[:stderr]
        end
        if shared_group
          lines << "Shared Example Group: \"#{shared_group.metadata[:shared_group_name]}\"" +
            " called from #{backtrace_formatter.backtrace_line(shared_group.location)}"
        end
        lines
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
serverspec-2.0.0.beta9 lib/serverspec.rb
serverspec-2.0.0.beta8 lib/serverspec.rb
serverspec-2.0.0.beta7 lib/serverspec.rb
serverspec-2.0.0.beta6 lib/serverspec.rb
serverspec-2.0.0.beta5 lib/serverspec.rb