Module: Protest::Stories::Methods

Defined in:
lib/protest/stories.rb

Instance Method Summary collapse

Instance Method Details

#report(text, &block) ⇒ Object



71
72
73
74
# File 'lib/protest/stories.rb', line 71

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

#silent(&block) ⇒ Object



76
77
78
79
80
81
82
83
84
# File 'lib/protest/stories.rb', line 76

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

  begin
    block.call
  ensure
    @scenario = scenario
  end
end