Sha256: 832c84386a1f16cd154ab5e392b1af0990341c557e08b32b636aa6d6123360f4

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

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

    def name
      self.class.name
    end
    
    def self.to_s
      name
    end
  end

  class SpecPassed < SpecStatus
    def to_s
      "."
    end

    def self.name
      "PASSING"
    end
  end

  class SpecFailed < SpecStatus
    def to_s
      "F"
    end

    def self.name
      "FAILING"
    end
  end

  class SpecSkipped < SpecStatus
    def to_s
      "S"
    end

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

    def self.name
      "NOT A NATURAL ASSERTION"
    end
  end

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

    def self.name
      "ERROR"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
matest-1.7.4 lib/matest/spec_status.rb
matest-1.7.3 lib/matest/spec_status.rb
matest-1.7.2 lib/matest/spec_status.rb
matest-1.7.1 lib/matest/spec_status.rb
matest-1.7.0 lib/matest/spec_status.rb
matest-1.6.9 lib/matest/spec_status.rb
matest-1.6.6 lib/matest/spec_status.rb
matest-1.6.5 lib/matest/spec_status.rb