Module: ParallelTests

Defined in:
lib/parallel_tests/railtie.rb,
lib/parallel_tests.rb,
lib/parallel_tests/tasks.rb,
lib/parallel_tests/grouper.rb,
lib/parallel_tests/version.rb,
lib/parallel_tests/test/runner.rb,
lib/parallel_tests/rspec/runner.rb,
lib/parallel_tests/cucumber/runner.rb,
lib/parallel_tests/rspec/logger_base.rb,
lib/parallel_tests/test/runtime_logger.rb,
lib/parallel_tests/cucumber/runtime_logger.rb,
lib/parallel_tests/cucumber/gherkin_listener.rb

Overview

rake tasks for Rails 3+

Defined Under Namespace

Modules: Cucumber, RSpec, Tasks, Test Classes: Grouper, Railtie

Constant Summary collapse

VERSION =
Version = '0.9.0'

Class Method Summary collapse

Class Method Details

.bundler_enabled?Boolean

copied from github.com/carlhuda/bundler Bundler::SharedHelpers#find_gemfile

Returns:

  • (Boolean)


16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/parallel_tests.rb', line 16

def self.bundler_enabled?
  return true if Object.const_defined?(:Bundler)

  previous = nil
  current = File.expand_path(Dir.pwd)

  until !File.directory?(current) || current == previous
    filename = File.join(current, "Gemfile")
    return true if File.exists?(filename)
    current, previous = File.expand_path("..", current), current
  end

  false
end

.determine_number_of_processes(count) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/parallel_tests.rb', line 7

def self.determine_number_of_processes(count)
  [
    count,
    ENV['PARALLEL_TEST_PROCESSORS'],
    Parallel.processor_count
  ].detect{|c| not c.to_s.strip.empty? }.to_i
end