test/support/factory.rb in deas-0.42.0 vs test/support/factory.rb in deas-0.43.0

- old
+ new

@@ -1,11 +1,13 @@ require 'assert/factory' require 'deas/logger' +require 'deas/request_data' require 'deas/router' require 'deas/server_data' require 'deas/template_source' require 'test/support/fake_request' +require 'test/support/fake_response' require 'test/support/fake_sinatra_call' module Factory extend Assert::Factory @@ -26,9 +28,23 @@ }.merge(opts || {})) end def self.request(args = nil) FakeRequest.new(args) + end + + def self.response(args = nil) + FakeResponse.new(args) + end + + def self.request_data(args = nil) + args ||= {} + Deas::RequestData.new({ + :request => args[:request] || Factory.request, + :response => args[:response] || Factory.response, + :params => args[:params] || { Factory.string => Factory.string }, + :route_path => args[:route_path] || Factory.string + }) end def self.sinatra_call(settings = nil) FakeSinatraCall.new(settings) end