Module: CI::Reporter::TestUtils::Rake

Defined in:
lib/ci/reporter/test_utils/rake.rb

Instance Method Summary collapse

Instance Method Details

#run_ruby_acceptance(cmd) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ci/reporter/test_utils/rake.rb', line 5

def run_ruby_acceptance(cmd)
  ENV['CI_REPORTS'] ||= "acceptance/reports"
  if ENV['RUBYOPT']
    opts = ENV['RUBYOPT']
    ENV['RUBYOPT'] = nil
  else
    opts = "-rubygems"
  end
  begin
    result_proc = proc {|ok,*| puts "Failures above are expected." unless ok }
    ruby "-Ilib #{opts} #{cmd}", &result_proc
  ensure
    ENV['RUBYOPT'] = opts if opts != "-rubygems"
    ENV.delete 'CI_REPORTS'
  end
end