Class: Stories::Runner

Inherits:
Test::Unit::UI::Console::TestRunner
  • Object
show all
Defined in:
lib/stories/runner.rb

Direct Known Subclasses

Runner::PDF

Instance Method Summary collapse

Instance Method Details

#add_fault(fault) ⇒ Object



79
80
81
82
# File 'lib/stories/runner.rb', line 79

def add_fault(fault)
  print "F"
  @faults << fault
end

#finished(elapsed_time) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/stories/runner.rb', line 84

def finished(elapsed_time)
  puts

  Stories.all.values.to_a.each_with_index do |story,i|
    puts "- #{story.name}"

    story.scenarios.each do |scenario|
      puts "    #{scenario.name}"

      unless scenario.steps.empty? && scenario.assertions.empty?
        scenario.steps.each do |step|
          puts "      #{step}"
        end

        scenario.assertions.each do |assertion|
          puts "      #{assertion}"
        end

        puts
      end
    end

    puts unless i + 1 == Stories.all.values.size
  end

  super
  puts "%d stories, %d scenarios" % [Stories.all.values.size, Stories.all.values.inject(0) {|total,s| total + s.scenarios.size }]
end

#test_finished(name) ⇒ Object



75
76
77
# File 'lib/stories/runner.rb', line 75

def test_finished(name)
  print "."
end