RSpec DSL should not pollute the Object namespace

This commit is contained in:
Luismi Cavalle 2011-03-12 12:38:48 +01:00
parent 6f2e8c547b
commit fee2a70220
2 changed files with 5 additions and 1 deletions

View File

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

View File

@ -24,6 +24,10 @@ feature "Capybara's feature DSL" do
scenario "runs background" do
@in_background.should be_true
end
scenario "doesn't pollute the Object namespace" do
Object.new.respond_to?(:feature, true).should be_false
end
end
feature "Capybara's feature DSL with driver", :driver => :culerity do