Class: CGIEmu

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

Overview

little fake cgi class that allows automated testing of cgi application

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.



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

def initialize(options)
  @test_options = options
  super()
end

Instance Attribute Details

#out_contentObject (readonly)

Returns the value of attribute out_content.



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

def out_content
  @out_content
end

#out_paramsObject (readonly)

Returns the value of attribute out_params.



5
6
7
# File 'lib/cuca/cgi_emu.rb', line 5

def out_params
  @out_params
end

Instance Method Details

#env_tableObject



56
57
58
# File 'lib/cuca/cgi_emu.rb', line 56

def env_table
  EnvTable.new(@test_options)
end

#out(params, &block) ⇒ Object



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

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

#stdinputObject



60
61
62
63
# File 'lib/cuca/cgi_emu.rb', line 60

def stdinput
#  $stderr.puts "Returning STDINPUT"
  StringIO.new("")
end