Sha256: 3a4535a94a049a95614258cec16e5ed979518aeaf895d08d2469422b40602e57

Contents?: true

Size: 1018 Bytes

Versions: 17

Compression:

Stored size: 1018 Bytes

Contents

#!/usr/bin/env ruby

# Print some whitespace
4.times { puts }
puts "Running RSpec tests..."
puts "======================"

# Check if we're looking at a Rails 2 / rspec 1 project
rspec1 = File.exists?('script/spec')
rspec_args = rspec1 ? ["spec", "-c"] : ["rspec"]

# Check if rspec_spinner is available
spinner_available = File.exists?('Gemfile') && File.open('Gemfile').read.scan(/rspec_spinner/).any?
spinner_args = spinner_available ? ['-r', 'rspec_spinner', '-f', 'RspecSpinner::Bar'] : []

# Check if parallel_tests is available
parallel_tests_available = ['rake', 'parallel:spec'] if File.exists?('Gemfile') && File.open('Gemfile').read.scan(/parallel_tests/).any?

use_parallel_tests = parallel_tests_available && (ARGV[0] == nil)

# Run examples in 'spec' unless an argument is given
ARGV[0] ||= 'spec'

if use_parallel_tests
  puts "Using parallel_tests ...\n\n"
  exec  *['b', 'rake', 'parallel:spec', ARGV].flatten
else
  # Run rspec behind bundler
  exec *["b", rspec_args, spinner_args, ARGV].flatten
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
geordi-0.9.7 bin/rs
geordi-0.9.6 bin/rs
geordi-0.9.5 bin/rs
geordi-0.9.4 bin/rs
geordi-0.9.3 bin/rs
geordi-0.9.2 bin/rs
geordi-0.9.1 bin/rs
geordi-0.9.0 bin/rs
geordi-0.8.1 bin/rs
geordi-0.8.0 bin/rs
geordi-0.7.0 bin/rs
geordi-0.6.1 bin/rs
geordi-0.6.0 bin/rs
geordi-0.5.0 bin/rs
geordi-0.4.6 bin/rs
geordi-0.4.5 bin/rs
geordi-0.4.4 bin/rs