Class: MockCGI

Inherits:
CGI
  • Object
show all
Defined in:
lib/upload_progress/test/multipart_progress_testx.rb

Constant Summary collapse

BOUNDARY =
'----------0xKhTmLbOuNdArY'
FILENAME =
'dummy.nul'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(size = 1000, url = '/test', &block) ⇒ MockCGI

Returns a new instance of MockCGI.



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 121

def initialize(size=1000, url='/test', &block)
  @url = url
  @env = {}
  @sio = MockIO.new('') { block.call(self) if block_given? }

  @upload_id = '1'

  add_param('param1', 'value1')
  add_data(size)
  add_param('param1', 'value2')
  add_end_boundary
  init_env
  @sio.rewind
  super()
end

Instance Attribute Details

#session_idObject (readonly)

Returns the value of attribute session_id.



119
120
121
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 119

def session_id
  @session_id
end

#session_optionsObject (readonly)

Returns the value of attribute session_options.



119
120
121
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 119

def session_options
  @session_options
end

#upload_idObject (readonly)

Returns the value of attribute upload_id.



119
120
121
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 119

def upload_id
  @upload_id
end

Instance Method Details

#env_tableObject



145
146
147
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 145

def env_table
  @env
end

#stdinputObject

def stdinput_without_progress

@sio

end



141
142
143
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 141

def stdinput
  @sio
end