Sha256: 0a1c81ff5d92d5099456040d9a4e7381de102d1812af1132139a902f41574934

Contents?: true

Size: 1018 Bytes

Versions: 7

Compression:

Stored size: 1018 Bytes

Contents

require 'spec/runner/option_parser'

module Spec
  module Runner
    # Facade to run specs without having to fork a new ruby process (using `spec ...`)
    class CommandLine
      # Runs specs. +argv+ is the commandline args as per the spec commandline API, +err+ 
      # and +out+ are the streams output will be written to. +exit+ tells whether or
      # not a system exit should be called after the specs are run and
      # +warn_if_no_files+ tells whether or not a warning (the help message)
      # should be printed to +err+ in case no files are specified.
      def self.run(argv, err, out, exit=true, warn_if_no_files=true)
        old_behaviour_runner = defined?($behaviour_runner) ? $behaviour_runner : nil
        $behaviour_runner = OptionParser.new.create_behaviour_runner(argv, err, out, warn_if_no_files)
        return if $behaviour_runner.nil? # This is the case if we use --drb

        $behaviour_runner.run(argv, exit)
        $behaviour_runner = old_behaviour_runner
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
has_finder-0.1.2 spec/rails/vendor/plugins/rspec/lib/spec/runner/command_line.rb
has_finder-0.1.1 spec/rails/vendor/plugins/rspec/lib/spec/runner/command_line.rb
has_finder-0.1.3 spec/rails/vendor/plugins/rspec/lib/spec/runner/command_line.rb
rspec-1.0.5 lib/spec/runner/command_line.rb
rspec-1.0.6 lib/spec/runner/command_line.rb
rspec-1.0.7 lib/spec/runner/command_line.rb
rspec-1.0.8 lib/spec/runner/command_line.rb