Skip to content

Commit

Permalink
Some explicit requires of RubyGems are necessary for integration tests.
Browse files Browse the repository at this point in the history
Should not affect the way Webrat behaves as a library.
  • Loading branch information
djanowski committed Apr 13, 2010
1 parent 10c70a3 commit deccefa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
16 changes: 7 additions & 9 deletions Rakefile
@@ -1,5 +1,3 @@
require "rubygems"

begin
require 'spec/rake/spectask'
rescue LoadError
Expand Down Expand Up @@ -90,14 +88,14 @@ namespace :spec do
namespace :rails do
task :selenium do
Dir.chdir "spec/integration/rails" do
result = system "rake test_unit:selenium"
result = system "rake -rubygems test_unit:selenium"
raise "Rails integration tests failed" unless result
end
end

task :webrat do
Dir.chdir "spec/integration/rails" do
result = system "rake test_unit:rails"
result = system "rake -rubygems test_unit:rails"
raise "Rails integration tests failed" unless result
end
end
Expand All @@ -106,31 +104,31 @@ namespace :spec do
desc "Run the Merb integration specs"
task :merb do
Dir.chdir "spec/integration/merb" do
result = system "rake spec"
result = system "rake -rubygems spec"
raise "Merb integration tests failed" unless result
end
end

desc "Run the Sinatra integration specs"
task :sinatra do
Dir.chdir "spec/integration/sinatra" do
result = system "rake test"
result = system "rake -rubygems test"
raise "Sinatra integration tests failed" unless result
end
end

desc "Run the Sinatra integration specs"
task :rack do
Dir.chdir "spec/integration/rack" do
result = system "rake test"
result = system "rake -rubygems test"
raise "Rack integration tests failed" unless result
end
end

desc "Run the Mechanize integration specs"
task :mechanize do
Dir.chdir "spec/integration/mechanize" do
result = system "rake spec"
result = system "rake -rubygems spec"
raise "Mechanize integration tests failed" unless result
end
end
Expand All @@ -142,4 +140,4 @@ task :whitespace do
sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
end

task :default => :spec
task :default => :spec
1 change: 1 addition & 0 deletions spec/integration/mechanize/spec/spec_helper.rb
@@ -1,3 +1,4 @@
require "rubygems"
require "spec"

$LOAD_PATH.unshift File.dirname(__FILE__) + "/../../../../lib"
Expand Down
2 changes: 2 additions & 0 deletions spec/integration/merb/spec/spec_helper.rb
@@ -1,3 +1,5 @@
require "rubygems"

$LOAD_PATH.unshift File.dirname(__FILE__) + "/../../../../lib"

# Add the local gems dir if found within the app root; any dependencies loaded
Expand Down
1 change: 1 addition & 0 deletions spec/integration/rack/test/webrat_rack_test.rb
@@ -1,3 +1,4 @@
require "rubygems"
require File.dirname(__FILE__) + "/helper"

class WebratRackTest < Test::Unit::TestCase
Expand Down
1 change: 1 addition & 0 deletions spec/integration/sinatra/test/classic_app_test.rb
@@ -1,3 +1,4 @@
require "rubygems"
require File.dirname(__FILE__) + "/test_helper"
require File.dirname(__FILE__) + "/../classic_app"

Expand Down

0 comments on commit deccefa

Please sign in to comment.