Module: SauceTest::RSpec::Runner

Defined in:
lib/sauce-test/rspec/runner.rb,
lib/sauce-test/rspec/sauce_formatter.rb

Defined Under Namespace

Classes: SauceFormatter

Class Method Summary collapse

Class Method Details

.rspec_initObject



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/sauce-test/rspec/runner.rb', line 24

def rspec_init
  out_str = StringIO.new
  err_str = StringIO.new
  spec_opt = Spec::Runner::Options.new(@err_str, @out_str)

  if @options.list
    spec_opt.dry_run = true
  else
    SauceTest::RSpec::Runner::SauceFormatter.set_sauce_test_options @options.sauce_options
  end

  if @options.example
    spec_opt.parse_example @options.example
  end

  spec_opt.parse_format SauceTest::RSpec::Runner::SauceFormatter.to_s
  spec_opt.files << @options.test_file

  Spec::Runner.use spec_opt
end

.run(options) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/sauce-test/rspec/runner.rb', line 15

def run(options)
  @options = options
  rspec_init
  Spec::Runner.run
  report = SauceTest::RSpec::Runner::SauceFormatter.report
  report.test_file = @options.test_file
  report
end