Class: RSpec::Core::CommandLine
- Inherits:
-
Object
- Object
- RSpec::Core::CommandLine
- Defined in:
- lib/rspec/core/command_line.rb
Instance Method Summary (collapse)
-
- (CommandLine) initialize(options, configuration = RSpec::configuration, world = RSpec::world)
constructor
A new instance of CommandLine.
-
- (Object) run(err, out)
Configures and runs a suite.
Constructor Details
- (CommandLine) initialize(options, configuration = RSpec::configuration, world = RSpec::world)
A new instance of CommandLine
4 5 6 7 8 9 10 11 12 |
# File 'lib/rspec/core/command_line.rb', line 4 def initialize(, configuration=RSpec::configuration, world=RSpec::world) if Array === = ConfigurationOptions.new() . end @options = @configuration = configuration @world = world end |
Instance Method Details
- (Object) run(err, out)
Configures and runs a suite
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rspec/core/command_line.rb', line 18 def run(err, out) @configuration.error_stream = err @configuration.output_stream ||= out @options.configure(@configuration) @configuration.load_spec_files @world.announce_filters @configuration.reporter.report(@world.example_count, @configuration.randomize? ? @configuration.seed : nil) do |reporter| begin @configuration.run_hook(:before, :suite) @world.example_groups.ordered.map {|g| g.run(reporter)}.all? ? 0 : @configuration.failure_exit_code ensure @configuration.run_hook(:after, :suite) end end end |