lib/jasmine/runners/phantom.rb in phantom_jasmine-0.0.2 vs lib/jasmine/runners/phantom.rb in phantom_jasmine-0.0.3

- old
+ new

@@ -1,6 +1,8 @@ +require 'facter' require 'tempfile' +require 'phantomjs-mac' if RUBY_PLATFORM.downcase.include?('darwin') class Jasmine::Runners::Phantom attr_accessor :suites def initialize(port, results_processor, result_batch_size) @@ -53,9 +55,9 @@ spec_results end def processor_count @processor_count ||= begin - ENV['JASMINE_PARALLEL_COUNT'] || [(`sysctl -n hw.ncpu` || 4).to_i, 4].min # 8 processes seems to use too much memory (500mb each!) + ENV['JASMINE_PARALLEL_COUNT'] || [Facter.sp_number_processors.to_i, 4].min end.to_i end end