# File lib/mspec/runner/exception.rb, line 4 def initialize(state, location, exception) @exception = exception @description = location ? "An exception occurred during: #{location}" : "" if state @description << "\n" unless @description.empty? @description << state.description @describe = state.describe @it = state.it else @describe = @it = "" end end
# File lib/mspec/runner/exception.rb, line 33 def backtrace @backtrace_filter ||= MSpecScript.config[:backtrace_filter] begin bt = @exception.awesome_backtrace.show.split "\n" rescue Exception bt = @exception.backtrace || [] end bt.select { |line| $MSPEC_DEBUG or @backtrace_filter !~ line }.join("\n") end
# File lib/mspec/runner/exception.rb, line 18 def failure? [SpecExpectationNotMetError, SpecExpectationNotFoundError].any? { |e| @exception.is_a? e } end
# File lib/mspec/runner/exception.rb, line 22 def message if @exception.message.empty? "<No message>" elsif @exception.class == SpecExpectationNotMetError || @exception.class == SpecExpectationNotFoundError @exception.message else "#{@exception.class}: #{@exception.message}" end end
Generated with the Darkfish Rdoc Generator 2.