Module: Test::Unit::Assertions

Defined in:
lib/stories/runner.rb

Instance Method Summary collapse

Instance Method Details

#report(text, &block) ⇒ Object



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

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

#silent(&block) ⇒ Object



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

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

  begin
    block.call
  ensure
    @scenario = scenario
  end
end