print warning when including Capybara::DSL globally

This commit is contained in:
Jonas Nicklas 2012-09-01 18:22:13 +02:00
parent 5c79469259
commit d153635e65
1 changed files with 9 additions and 0 deletions

View File

@ -2,6 +2,15 @@ require 'capybara'
module Capybara
module DSL
def self.included(base)
warn "including Capybara::DSL in the global scope is not recommended!" if base == Object
super
end
def self.extended(base)
warn "extending the main object with Capybara::DSL is not recommended!" if base == TOPLEVEL_BINDING.eval("self")
super
end
##
#