lib/capybara/json.rb in capybara-json-0.0.1 vs lib/capybara/json.rb in capybara-json-0.0.2
- old
+ new
@@ -1,11 +1,15 @@
require 'capybara'
require 'capybara/dsl'
module Capybara
module Json
+ def self.to_include
+ Capybara.const_defined?("DSL") ? Capybara::DSL : Capybara
+ end
+
def self.included(base)
- base.__send__(:include, Capybara::DSL) unless base < Capybara or base < Capybara::DSL
+ base.__send__(:include, to_include) unless base < to_include
base.extend(self)
end
%w[ get delete ].each do |method|
module_eval %{