Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Exclude selenium/ from default spec task on RSpec 1.x

  • Loading branch information...
commit 9d9889aa20ca1fcc1d89d1d59becabce5455de95 1 parent b20ae3b
@epall epall authored
Showing with 21 additions and 1 deletion.
  1. +8 −1 lib/sauce/integrations.rb
  2. +13 −0 lib/sauce/raketasks.rb
View
9 lib/sauce/integrations.rb
@@ -4,10 +4,17 @@ module Sauce
module RSpec
class SeleniumExampleGroup < Spec::Example::ExampleGroup
attr_reader :selenium
+ @@need_tunnel = false
+
+ def self.inherited(subclass)
+ # only setup tunnel if somebody needs it
+ @@need_tunnel = true
+ super(subclass)
+ end
before :suite do
config = Sauce::Config.new
- if config.application_host && !config.local?
+ if @@need_tunnel && config.application_host && !config.local?
@@tunnel = Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
@@tunnel.wait_until_ready
end
View
13 lib/sauce/raketasks.rb
@@ -4,6 +4,12 @@
task :noop do
end
+class Rake::Task
+ def abandon
+ @actions.clear
+ end
+end
+
include Sauce::Utilities
if defined?(Spec::Rake::SpecTask)
@@ -34,6 +40,13 @@
task :selenium => "selenium:sauce"
end
+
+ Rake::Task[:spec].abandon
+ desc "Run all specs in spec directory (excluding plugin specs)"
+ Spec::Rake::SpecTask.new(:spec => spec_prereq) do |t|
+ t.spec_opts = ['--options', "\"#{RAILS_ROOT}/spec/spec.opts\""]
+ t.spec_files = FileList['spec/**/*_spec.rb'].exclude('spec/selenium/*')
+ end
end
if defined?(RSpec::Core::RakeTask)
Please sign in to comment.
Something went wrong with that request. Please try again.