Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
Exclude selenium/ from default spec task on RSpec 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
epall committed Dec 14, 2010
1 parent b20ae3b commit 9d9889a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/sauce/integrations.rb
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions lib/sauce/raketasks.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9d9889a

Please sign in to comment.