Module: Rootage::ScenarioTest
- Defined in:
- lib/rootage/test-helper.rb
Overview
This module helps tests of command execution.
Class Method Summary collapse
-
.fail(scenario, args = nil, &block) ⇒ Object
Run the action, expecting scenario execution fails.
-
.succeed(scenario, args = nil, &block) ⇒ Object
Run the action, expecting scenario execution succeeds.
Class Method Details
.fail(scenario, args = nil, &block) ⇒ Object
Run the action, expecting scenario execution fails.
57 58 59 60 61 62 |
# File 'lib/rootage/test-helper.rb', line 57 def fail(scenario, args=nil, &block) res = execute(scenario, args, &block) res.report if res.success? res.should.not.success return res end |
.succeed(scenario, args = nil, &block) ⇒ Object
Run the action, expecting scenario execution succeeds.
49 50 51 52 53 54 |
# File 'lib/rootage/test-helper.rb', line 49 def succeed(scenario, args=nil, &block) res = execute(scenario, args, &block) res.report if not(res.success?) res.success?.should.be.true return res end |