lib/capybara/rack_test_json/client.rb in capybara-json-0.2.3 vs lib/capybara/rack_test_json/client.rb in capybara-json-0.2.4
- old
+ new
@@ -9,19 +9,19 @@
def initialize(app, options)
@app, @options = app, options
end
%w[ get post put delete ].each do |method|
- module_eval %{
+ module_eval <<-DEF, __FILE__, __LINE__+1
def #{method}(uri, params = {}, env = {}, &block)
env = env.merge(:method => "#{method.upcase}", :params => params)
if options[:follow_redirect]
request_with_follow_redirect(uri, env, &block)
else
request(uri, env)
end
end
- }
+ DEF
end
def request_with_follow_redirect(uri, env)
request(uri, env)
(5+1).times do