Init C[ue]lerity driver/session in before(:all)

This way we don't create a crap load of instances
which leads to out-of-memory exceptions.
This commit is contained in:
Jonas Nicklas 2010-02-26 01:14:58 +01:00
parent 2f3dc8f534
commit 0ed383238f
5 changed files with 7 additions and 10 deletions

View File

@ -2,7 +2,7 @@ require File.expand_path('../spec_helper', File.dirname(__FILE__))
if RUBY_PLATFORM =~ /java/
describe Capybara::Driver::Celerity do
before do
before(:all) do
@driver = Capybara::Driver::Celerity.new(TestApp)
end
@ -14,4 +14,4 @@ if RUBY_PLATFORM =~ /java/
end
else
puts "#{File.basename(__FILE__)} requires JRuby; skipping.."
end
end

View File

@ -1,7 +1,7 @@
require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Driver::Culerity do
before do
before(:all) do
@driver = Capybara::Driver::Culerity.new(TestApp)
end

View File

@ -1,13 +1,10 @@
require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Driver::Culerity do
before do
@driver = Capybara::Driver::Culerity.new(TestApp)
end
before(:all) do
Capybara.app_host = "http://capybara-testapp.heroku.com"
Capybara.run_server = false
@driver = Capybara::Driver::Culerity.new(TestApp)
end
after(:all) do

View File

@ -2,7 +2,7 @@ require File.expand_path('../spec_helper', File.dirname(__FILE__))
if RUBY_PLATFORM =~ /java/
describe Capybara::Driver::Celerity do
before do
before(:all) do
@session = Capybara::Session.new(:celerity, TestApp)
end
@ -24,4 +24,4 @@ if RUBY_PLATFORM =~ /java/
end
else
puts "#{File.basename(__FILE__)} requires JRuby; skipping.."
end
end

View File

@ -2,7 +2,7 @@ require File.expand_path('../spec_helper', File.dirname(__FILE__))
describe Capybara::Session do
context 'with culerity driver' do
before do
before(:all) do
@session = Capybara::Session.new(:culerity, TestApp)
end