Class: Mu::Xtractr::Stream::HTTP::Test
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- Mu::Xtractr::Stream::HTTP::Test
- Defined in:
- lib/mu/xtractr/test/stream/tc_http.rb
Instance Attribute Summary collapse
-
#flow ⇒ Object
readonly
Returns the value of attribute flow.
-
#xtractr ⇒ Object
readonly
Returns the value of attribute xtractr.
Instance Method Summary collapse
Instance Attribute Details
#flow ⇒ Object (readonly)
Returns the value of attribute flow.
24 25 26 |
# File 'lib/mu/xtractr/test/stream/tc_http.rb', line 24 def flow @flow end |
#xtractr ⇒ Object (readonly)
Returns the value of attribute xtractr.
23 24 25 |
# File 'lib/mu/xtractr/test/stream/tc_http.rb', line 23 def xtractr @xtractr end |
Instance Method Details
#setup ⇒ Object
26 27 28 |
# File 'lib/mu/xtractr/test/stream/tc_http.rb', line 26 def setup @xtractr = Xtractr.new end |
#test_extract ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/mu/xtractr/test/stream/tc_http.rb', line 30 def test_extract stream = xtractr.packets('http.content.type:gif').first.flow.stream assert_equal(1, stream.contents.size) content = stream.contents.first assert_nothing_raised { content.inspect } assert_equal('image/gif', content.type) assert_nil(content.encoding) assert_equal('content.4.1', content.name) assert_equal(content..__id__, stream.[1].__id__) stream = xtractr.packets('http.content.type:xml').first.flow.stream assert_equal(1, stream.contents.size) content = stream.contents.first assert_nothing_raised { content.inspect } assert_equal('text/xml', content.type) assert_equal('gzip', content.encoding) assert_equal('content.2.1', content.name) assert_equal(content..__id__, stream.[1].__id__) end |