Module: RBehave::Runner
- Defined in:
- lib/rbehave/runner.rb,
lib/rbehave/runner/options.rb,
lib/rbehave/runner/story_runner.rb,
lib/rbehave/runner/scenario_runner.rb,
lib/rbehave/runner/scenario_collector.rb
Defined Under Namespace
Classes: Options, ScenarioCollector, ScenarioRunner, StoryRunner
Class Method Summary
collapse
Class Method Details
.dry_run ⇒ Object
43
44
45
|
# File 'lib/rbehave/runner.rb', line 43
def dry_run
options.dry_run
end
|
.options ⇒ Object
4
5
6
|
# File 'lib/rbehave/runner.rb', line 4
def options
@options ||= Options.new.parse ARGV
end
|
.register_exit_hook ⇒ Object
.story_runner ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/rbehave/runner.rb', line 8
def story_runner
unless @story_runner
scenario_runner = ScenarioRunner.new
RBehave::Runner.register_exit_hook
world_creator = World
@story_runner = StoryRunner.new(scenario_runner, world_creator)
unless options.dry_run
reporter = RBehave::Reporter::PlainTextReporter.new($stdout)
scenario_runner.add_listener(reporter)
@story_runner.add_listener(reporter)
end
case options.format
when :simple then documenter = RBehave::Documenter::PlainTextDocumenter.new($stdout)
when nil ;
else raise "Unimplemented format - #{options.format.to_s}"
end
if documenter
scenario_runner.add_listener(documenter)
@story_runner.add_listener(documenter)
world_creator.add_listener(documenter)
end
end
@story_runner
end
|