Files

Class/Module Index [+]

Quicksearch

YamlFormatter

Public Class Methods

new(out=nil) click to toggle source
# File lib/mspec/runner/formatters/yaml.rb, line 5
def initialize(out=nil)
  @exception = @failure = false
  @exceptions = []
  @count = 0
  @out = $stdout

  if out.nil?
    @finish = $stdout
  else
    @finish = File.open out, "w"
  end
end

Public Instance Methods

after(state) click to toggle source
# File lib/mspec/runner/formatters/yaml.rb, line 22
def after(state)
end
finish() click to toggle source
# File lib/mspec/runner/formatters/yaml.rb, line 25
def finish
  switch

  print "---\n"
  print "exceptions:\n"
  @exceptions.each do |exc|
    outcome = exc.failure? ? "FAILED" : "ERROR"
    str =  "#{exc.description} #{outcome}\n"
    str << exc.message << "\n" << exc.backtrace
    print "- ", str.inspect, "\n"
  end

  print "time: ",         @timer.elapsed,              "\n"
  print "files: ",        @tally.counter.files,        "\n"
  print "examples: ",     @tally.counter.examples,     "\n"
  print "expectations: ", @tally.counter.expectations, "\n"
  print "failures: ",     @tally.counter.failures,     "\n"
  print "errors: ",       @tally.counter.errors,       "\n"
end
switch() click to toggle source
# File lib/mspec/runner/formatters/yaml.rb, line 18
def switch
  @out = @finish
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.