Sha256: 359e81b0e454f2a6942b576edd7c42e3525debc5278ff90ef716e4a8d439dcd2

Contents?: true

Size: 798 Bytes

Versions: 1

Compression:

Stored size: 798 Bytes

Contents

require 'test/unit'
require 'test/unit/assertions'
require 'rexml/document'

require 'nitro/context'

module Nitro

# Override the default Request implementation
# to include methods useful for testing.

module Request
end

# Override the default Response implementation
# to include methods useful for testing.

module Response

	def status_ok?
		@status == 200
	end

	def redirect?
		(300..399).include?(@status)
	end

	def redirect_url
		@response_headers['location']
	end

	def response_cookie(name)
		return nil unless @response_cookies
		@response_cookies.find { |c| c.name == name }
	end

end

# Override the default Context implementation
# to include methods useful for testing.

class Context
	def session
		@session || @session = {}
	end	
end

end

# * George Moschovitis  <gm@navel.gr>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.20.0 lib/nitro/testing/context.rb