Merge remote branch 'cavalle/object_pollution'

Conflicts:
	spec/rspec/features_spec.rb
This commit is contained in:
Jonas Nicklas and Nicklas Ramhöj 2011-03-31 18:05:58 +02:00
commit 7fb5a1da3a
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ module Capybara
end end
end end
def feature(*args, &block) def self.feature(*args, &block)
options = if args.last.is_a?(Hash) then args.pop else {} end options = if args.last.is_a?(Hash) then args.pop else {} end
options[:capybara_feature] = true options[:capybara_feature] = true
options[:type] = :request options[:type] = :request

View File

@ -28,10 +28,14 @@ feature "Capybara's feature DSL" do
scenario "runs background" do scenario "runs background" do
@in_background.should be_true @in_background.should be_true
end end
scenario "runs hooks filtered by file path" do scenario "runs hooks filtered by file path" do
@in_filtered_hook.should be_true @in_filtered_hook.should be_true
end end
scenario "doesn't pollute the Object namespace" do
Object.new.respond_to?(:feature, true).should be_false
end
end end
feature "Capybara's feature DSL with driver", :driver => :culerity do feature "Capybara's feature DSL with driver", :driver => :culerity do