test/support/fake_sinatra_call.rb in deas-0.37.0 vs test/support/fake_sinatra_call.rb in deas-0.37.1
- old
+ new
@@ -8,11 +8,11 @@
attr_accessor :request, :response, :params, :logger, :router, :session
attr_accessor :settings
def initialize(settings = nil)
@request = FakeRequest.new('GET','/something', {}, OpenStruct.new)
- @response = FakeResponse.new
+ @response = FakeResponse.new(Factory.integer, {}, [Factory.text])
@session = @request.session
@params = @request.params
@logger = Deas::NullLogger.new
@router = Deas::Router.new
@template_source = Deas::NullTemplateSource.new
@@ -22,9 +22,13 @@
@headers = {}
@settings = OpenStruct.new({
:deas_server_data => Factory.server_data
}.merge(settings || {}))
+ end
+
+ def call(env)
+ [@response.status, @response.headers, [@response.body]]
end
def halt(*args)
throw :halt, args
end