lib/capybara/json.rb in capybara-json-0.2.3 vs lib/capybara/json.rb in capybara-json-0.2.4
- old
+ new
@@ -13,22 +13,30 @@
base.__send__(:include, to_include) unless base < to_include
base.extend(self)
end
%w[ get get! delete delete! ].each do |method|
- module_eval %{
+ module_eval <<-DEF, __FILE__, __LINE__ + 1
def #{method}(path, params = {}, env = {})
page.driver.#{method}(path, params, env)
end
- }
+ DEF
end
%w[ post post! put put! ].each do |method|
- module_eval %{
+ module_eval <<-DEF, __FILE__, __LINE__ + 1
def #{method}(path, json, env = {})
page.driver.#{method}(path, json, env)
end
- }
+ DEF
+ end
+
+ %w[ json ].each do |method|
+ module_eval <<-DEF, __FILE__, __LINE__ + 1
+ def #{method}
+ page.driver.#{method}
+ end
+ DEF
end
autoload :Error, 'capybara/json/error'
module Driver