Sha256: 572f84371b77e4e8f62550ec51590f8a9a5274b0b2cf7adca05630298f9e8d22

Contents?: true

Size: 931 Bytes

Versions: 10

Compression:

Stored size: 931 Bytes

Contents

module Specjour
  module Rspec
    class ::Spec::Runner::Reporter::Failure

      def initialize(group_description, example_description, exception)
        @example_name = "#{group_description} #{example_description}"
        @exception = MarshalableException.new(exception)
        @pending_fixed = exception.is_a?(Spec::Example::PendingExampleFixedError)
        @exception_not_met = exception.is_a?(Spec::Expectations::ExpectationNotMetError)
      end

      def pending_fixed?
        @pending_fixed
      end

      def expectation_not_met?
        @exception_not_met
      end
    end
  end

  class MarshalableException
    attr_accessor :message, :backtrace, :class_name

    def initialize(exception)
      self.class_name = exception.class.name
      self.message = exception.message
      self.backtrace = exception.backtrace
    end

    def class
      @class ||= OpenStruct.new :name => class_name
    end
  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
specjour-0.3.0.rc2 lib/specjour/rspec/marshalable_rspec_failure.rb
specjour-0.3.0.rc1 lib/specjour/rspec/marshalable_rspec_failure.rb
relex-specjour-0.2.7 lib/specjour/rspec/marshalable_rspec_failure.rb
JonathanTron-specjour-0.2.5.1 lib/specjour/rspec/marshalable_rspec_failure.rb
relex-specjour-0.2.6 lib/specjour/rspec/marshalable_rspec_failure.rb
specjour-0.2.5 lib/specjour/rspec/marshalable_rspec_failure.rb
specjour-0.2.4 lib/specjour/rspec/marshalable_rspec_failure.rb
specjour-0.2.3 lib/specjour/rspec/marshalable_rspec_failure.rb
specjour-0.2.2 lib/specjour/rspec/marshalable_rspec_failure.rb
specjour-0.2.1 lib/specjour/rspec/marshalable_rspec_failure.rb