Class: MockCGI
- Defined in:
- lib/upload_progress/test/multipart_progress_testx.rb
Constant Summary collapse
- BOUNDARY =
'----------0xKhTmLbOuNdArY'
- FILENAME =
'dummy.nul'
Instance Attribute Summary collapse
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
-
#session_options ⇒ Object
readonly
Returns the value of attribute session_options.
-
#upload_id ⇒ Object
readonly
Returns the value of attribute upload_id.
Instance Method Summary collapse
- #env_table ⇒ Object
-
#initialize(size = 1000, url = '/test', &block) ⇒ MockCGI
constructor
A new instance of MockCGI.
-
#stdinput ⇒ Object
def stdinput_without_progress @sio end.
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_id ⇒ Object (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_options ⇒ Object (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 end |
#upload_id ⇒ Object (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_table ⇒ Object
145 146 147 |
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 145 def env_table @env end |
#stdinput ⇒ Object
def stdinput_without_progress
@sio
end
141 142 143 |
# File 'lib/upload_progress/test/multipart_progress_testx.rb', line 141 def stdinput @sio end |