test/helper.rb in impression-0.2 vs test/helper.rb in impression-0.3

- old
+ new

@@ -39,36 +39,36 @@ msg = message(msg) { "Expected #{mu_pp(act)} to be in range #{mu_pp(exp_range)}" } assert exp_range.include?(act), msg end def assert_response exp_body, exp_content_type, req - msg = message(msg) { "Expected response body #{mu_pp(act)} to equal #{mu_pp(exp_body)}" } - assert_equal exp_body, req.response_body, msg + actual = req.response_body + assert_equal exp_body.gsub("\n", ''), actual&.gsub("\n", '') return unless exp_content_type if Symbol === exp_content_type exp_content_type = Qeweney::MimeTypes[exp_content_type] end - msg = message(msg) { "Expected response content type #{mu_pp(act)} to equal #{mu_pp(exp_body)}" } - assert_equal exp_content_type, req.response_content_type, msg + actual = req.response_content_type + assert_equal exp_content_type, actual end end class Impression::Resource - def route_and_respond(req) - route(req).respond(req) + def route_and_call(req) + route(req).call(req) end end class PathRenderingResource < Impression::Resource - def respond(req) + def call(req) req.respond(absolute_path) end end class CompletePathInfoRenderingResource < Impression::Resource - def respond(req) + def call(req) req.respond("#{absolute_path} #{req.resource_relative_path}") end end # Extensions to be used in conjunction with `Qeweney::TestAdapter`