spec: rspec 2.13 parallelized_specs compatibility

Change-Id: I3600a84a6b7bde5bc6b25bfcd8ff448dfed4463f
Reviewed-on: https://gerrit.instructure.com/28736
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Shawn Meredith <shawn@instructure.com>
This commit is contained in:
Shawn Meredith 2014-01-16 14:37:07 -07:00
parent 501e760528
commit 26464cde51
3 changed files with 40 additions and 11 deletions

View File

@ -1,10 +1,22 @@
#!/usr/bin/env ruby
if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg)}
if ARGV.any? { |arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg) }
require 'rubygems' unless ENV['NO_RUBYGEMS']
else
gem 'test-unit', '1.2.3'
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.dirname(__FILE__) + "/../config/environment") unless defined?(Rails)
end
require 'spec/autorun'
exit ::Spec::Runner::CommandLine.run
if CANVAS_RAILS2
require 'spec/autorun'
exit ::Spec::Runner::CommandLine.run
else
require 'rspec/autorun'
#make sure ARGV which is a filelist gets flattened and passed
#correctly this solution just runs the first file
exit ::RSpec::Core::Runner.run(ARGV)
end

View File

@ -1,11 +1,28 @@
require 'spec/runner/formatter/nested_text_formatter'
if CANVAS_RAILS2
module RSpec
class NestedInstafailFormatter < Spec::Runner::Formatter::NestedTextFormatter
def example_failed(example, counter, failure)
super
dump_failure(counter, failure)
output.puts
require 'spec/runner/formatter/nested_text_formatter'
module RSpec
class NestedInstafailFormatter < Spec::Runner::Formatter::NestedTextFormatter
def example_failed(example, counter, failure)
super
dump_failure(counter, failure)
output.puts
end
end
end
else
require 'rspec/core/formatters/base_text_formatter'
module RSpec
class NestedInstafailFormatter < RSpec::Core::Formatters::BaseTextFormatter
def example_failed(example)
super
#dump_failure(counter, failure)
output.puts
end
end
end
end

View File

@ -85,7 +85,7 @@ module SeleniumTestsHelperMethods
end
begin
tries ||= 3
puts "Thread #{THIS_ENV} connecting to hub over port #{PORT_NUM}, try ##{tries}"
puts "Thread: provisioning selenium driver"
driver = nil
driver = Selenium::WebDriver.for(browser, options)
rescue Exception => e