Sha256: 3e4e5fca0acf5c8b6c1b401ea8753dde566f5e38daf5a797f6f49191d19c9d57

Contents?: true

Size: 933 Bytes

Versions: 24

Compression:

Stored size: 933 Bytes

Contents

module Matest
  class SpecStatus
    attr_reader :example
    attr_reader :result

    def initialize(example, result, description=nil)
      @example = example
      @result = result
    end

    def location
      "%s:%d" % example.example_block.source_location
    end

    def description
      example.description
    end
  end

  class SpecPassed < SpecStatus
    def to_s
      "."
    end

    def name
      "PASSING"
    end
  end

  class SpecFailed < SpecStatus
    def to_s
      "F"
    end

    def name
      "FAILING"
    end
  end

  class SpecSkipped < SpecStatus
    def to_s
      "S"
    end

    def name
      "SKIPPED"
    end
  end
  class NotANaturalAssertion < SpecStatus
    def to_s
      "N"
    end

    def name
      "NOT A NATURAL ASSERTION"
    end
  end

  class ExceptionRaised < SpecStatus
    attr_reader :exception
    def to_s
      "E"
    end

    def name
      "ERROR"
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
matest-1.6.4 lib/matest/spec_status.rb
matest-1.6.3 lib/matest/spec_status.rb
matest-1.6.2 lib/matest/spec_status.rb
matest-1.6.1 lib/matest/spec_status.rb
matest-1.6.0 lib/matest/spec_status.rb
matest-1.5.6 lib/matest/spec_status.rb
matest-1.5.5 lib/matest/spec_status.rb
matest-1.5.4 lib/matest/spec_status.rb
matest-1.5.3 lib/matest/spec_status.rb
matest-1.5.2 lib/matest/spec_status.rb
matest-1.5.1 lib/matest/spec_status.rb
matest-1.5.0 lib/matest/spec_status.rb
matest-1.4.1 lib/matest/spec_status.rb
matest-1.4.0 lib/matest/spec_status.rb
matest-1.3.2 lib/matest/spec_status.rb
matest-1.3.1 lib/matest/spec_status.rb
matest-1.3.0 lib/matest/spec_status.rb
matest-1.2.0 lib/matest/spec_status.rb
matest-1.1.4 lib/matest/spec_status.rb
matest-1.1.3 lib/matest/spec_status.rb