Module: Test::Unit::Assertions

Defined in:
lib/stories/runner.rb

Instance Method Summary collapse

Instance Method Details

#report(text, &block) ⇒ Object


38
39
40
41
# File 'lib/stories/runner.rb', line 38

def report(text, &block)
  @scenario.steps << text
  silent(&block) if block_given?
end

#silent(&block) ⇒ Object


43
44
45
46
47
48
49
50
51
# File 'lib/stories/runner.rb', line 43

def silent(&block)
  scenario, @scenario = @scenario, Stories::Scenario.new("#{@scenario.name} (Silent)")

  begin
    block.call
  ensure
    @scenario = scenario
  end
end