Class: CGIEmu

Inherits:
CGI
  • Object
show all
Defined in:
lib/cuca/cgi_emu.rb

Defined Under Namespace

Classes: EnvTable

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from CGI

#cgidump, fix_env, #parameters, #query_parameters, #request_parameters

Constructor Details

#initialize(options) ⇒ CGIEmu

Returns a new instance of CGIEmu.



74
75
76
77
78
79
# File 'lib/cuca/cgi_emu.rb', line 74

def initialize(options)
  @content =  options['CONTENT'] || ''
  options.delete('CONTENT')
  @test_options = options
  super()
end

Instance Attribute Details

#out_contentObject (readonly)

Returns the value of attribute out_content.



8
9
10
# File 'lib/cuca/cgi_emu.rb', line 8

def out_content
  @out_content
end

#out_paramsObject (readonly)

Returns the value of attribute out_params.



7
8
9
# File 'lib/cuca/cgi_emu.rb', line 7

def out_params
  @out_params
end

#output_cookiesObject (readonly)

made by CGI::Session



10
11
12
# File 'lib/cuca/cgi_emu.rb', line 10

def output_cookies
  @output_cookies
end

Instance Method Details

#env_tableObject



66
67
68
# File 'lib/cuca/cgi_emu.rb', line 66

def env_table
  EnvTable.new(@test_options)
end

#out(params, &block) ⇒ Object



81
82
83
84
# File 'lib/cuca/cgi_emu.rb', line 81

def out(params, &block)
  @out_params = params
  @out_content = block.call
end

#stdinputObject



70
71
72
# File 'lib/cuca/cgi_emu.rb', line 70

def stdinput
  StringIO.new(@content)
end