Sha256: c5583819331dc3c51459a5fa7ba34642ecbe30dc59b3f65d5e3e537a2cf38124
Contents?: true
Size: 696 Bytes
Versions: 6
Compression:
Stored size: 696 Bytes
Contents
require 'ostruct' class FakeRequest < Struct.new(:http_method, :path, :params, :session, :env) alias :request_method :http_method attr_reader :logging_msgs def initialize(args = nil) args ||= {} super(*[ args[:http_method] || 'GET', args[:path] || Factory.path, args[:params] || {}, args[:session] || OpenStruct.new, args[:env] || {} ]) self.env.merge!({ 'rack.url_scheme' => Factory.boolean ? 'http' : 'https', 'HTTP_HOST' => "#{Factory.string}.#{Factory.string}", 'deas.logging' => Proc.new do |msg| @logging_msgs ||= [] @logging_msgs.push(msg) end }) end end
Version data entries
6 entries across 6 versions & 1 rubygems