Class: Rspec2Adapter
- Inherits:
-
Object
- Object
- Rspec2Adapter
- Defined in:
- lib/shared/adapters/rspec2_adapter.rb
Class Method Summary collapse
- .base_path ⇒ Object
- .command(project_path, ruby_interpreter, files) ⇒ Object
- .get_sizes(files) ⇒ Object
- .name ⇒ Object
- .pluralized ⇒ Object
- .requester_port ⇒ Object
- .test_files(dir) ⇒ Object
- .type ⇒ Object
Class Method Details
.base_path ⇒ Object
43 44 45 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 43 def self.base_path "spec" end |
.command(project_path, ruby_interpreter, files) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 5 def self.command(project_path, ruby_interpreter, files) spec_command = RubyEnv.ruby_command(project_path, :bin => "rspec", :ruby_interpreter => ruby_interpreter) if File.exists?("#{project_path}/spec/spec.opts") spec_command += " -O spec/spec.opts" end "export RSPEC_COLOR=true; #{spec_command} #{files}" end |
.get_sizes(files) ⇒ Object
31 32 33 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 31 def self.get_sizes(files) files.map { |file| File.stat(file).size } end |
.name ⇒ Object
47 48 49 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 47 def self.name 'RSpec2' end |
.pluralized ⇒ Object
39 40 41 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 39 def self.pluralized 'specs' end |
.requester_port ⇒ Object
35 36 37 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 35 def self.requester_port 2299 end |
.test_files(dir) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 17 def self.test_files(dir) if ENV['SELENIUM_SPECS'] puts 'running selenium specs' test_files = FileList['spec/selenium/**/*_spec.rb'] + FileList['vendor/plugins/*/spec_canvas/selenium/*_spec.rb'] elsif ENV['PLUGIN_SPECS'] puts 'running plugin specs' test_files = FileList['vendor/plugins/*/spec_canvas/**/*_spec.rb'].exclude('vendor/plugins/*/spec_canvas/selenium/*_spec.rb') + FileList['spec/**/*_spec.rb'].exclude('spec/selenium/**/*_spec.rb') :ew3else puts 'normal pattern' test_files = Dir["#{dir}/#{file_pattern}"] end test_files end |
.type ⇒ Object
51 52 53 |
# File 'lib/shared/adapters/rspec2_adapter.rb', line 51 def self.type 'rspec' end |