Navigation Menu

Skip to content

Commit

Permalink
Reset both before and after examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jnicklas committed Nov 28, 2012
1 parent 56abb4f commit 68d0157
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/capybara/spec/spec_helper.rb
Expand Up @@ -9,7 +9,7 @@ module Capybara
module SpecHelper
class << self
def configure(config)
filter = lambda do |requires, metadata|
filter = Proc.new do |requires, metadata|
if requires and metadata[:skip]
requires.any? do |require|
metadata[:skip].include?(require)
Expand All @@ -19,16 +19,14 @@ def configure(config)
end
end
config.filter_run_excluding :requires => filter
config.before do
reset = Proc.new do
Capybara.app = TestApp
Capybara.app_host = nil

Capybara.configure do |config|
config.default_selector = :xpath
end

Capybara.default_selector = :xpath
Capybara.default_wait_time = 1
end
config.before(:each, &reset)
config.after(:each, &reset)
end

def spec(name, options={}, &block)
Expand Down

0 comments on commit 68d0157

Please sign in to comment.