Sha256: bc56d859725a0e6cb3754ee5fa5d140568e3dadb42001390be9e4a2aa6a5a21d

Contents?: true

Size: 1.09 KB

Versions: 7

Compression:

Stored size: 1.09 KB

Contents

module RSpec
  module Core
    class CommandLine
      def initialize(options, configuration=RSpec::configuration, world=RSpec::world)
        if Array === options
          options = ConfigurationOptions.new(options)
          options.parse_options
        end
        @options       = options
        @configuration = configuration
        @world         = world
      end

      # Configures and runs a suite
      #
      # @param [IO] err
      # @param [IO] out
      def run(err, out)
        @configuration.error_stream = err
        @configuration.output_stream = out if @configuration.output_stream == $stdout
        @options.configure(@configuration)
        @configuration.load_spec_files
        @world.announce_filters

        @configuration.reporter.report(@world.example_count) do |reporter|
          begin
            @configuration.run_hook(:before, :suite)
            @world.ordered_example_groups.map {|g| g.run(reporter) }.all? ? 0 : @configuration.failure_exit_code
          ensure
            @configuration.run_hook(:after, :suite)
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
opal-rspec-cj-0.4.4 vendor_lib/rspec/core/command_line.rb
opal-rspec-0.4.3 vendor_lib/rspec/core/command_line.rb
opal-rspec-0.4.2 vendor_lib/rspec/core/command_line.rb
opal-rspec-0.4.1 vendor_lib/rspec/core/command_line.rb
opal-rspec-0.4.0 vendor_lib/rspec/core/command_line.rb
opal-rspec-0.4.0.beta4 vendor_lib/rspec/core/command_line.rb
rspec-core-3.0.0.beta1 lib/rspec/core/command_line.rb