Class: Mu::Xtractr::Stream::Test
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- Mu::Xtractr::Stream::Test
- Defined in:
- lib/mu/xtractr/test/tc_stream.rb
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#xtractr ⇒ Object
readonly
Returns the value of attribute xtractr.
Instance Method Summary collapse
- #setup ⇒ Object
- #test_each ⇒ Object
- #test_flow ⇒ Object
- #test_inspect ⇒ Object
- #test_Stream ⇒ Object
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
23 24 25 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 23 def stream @stream end |
#xtractr ⇒ Object (readonly)
Returns the value of attribute xtractr.
22 23 24 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 22 def xtractr @xtractr end |
Instance Method Details
#setup ⇒ Object
25 26 27 28 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 25 def setup @xtractr = Xtractr.new @stream = xtractr.flows('flow.service:HTTP').first.stream end |
#test_each ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 38 def test_each assert_equal(stream.method(:each), stream.method(:each_message)) assert_equal(2, stream..size) stream.each_with_index do |m, i| assert_kind_of(Stream::Message, m) assert_equal(i, m.index) assert_equal(stream.__id__, m.stream.__id__) assert_equal(true, m.dir == 0 || m.dir == 1) assert_nothing_raised { m.inspect } end end |
#test_flow ⇒ Object
34 35 36 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 34 def test_flow assert_kind_of(Flow, stream.flow) end |
#test_inspect ⇒ Object
50 51 52 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 50 def test_inspect assert_nothing_raised { stream.inspect } end |
#test_Stream ⇒ Object
30 31 32 |
# File 'lib/mu/xtractr/test/tc_stream.rb', line 30 def test_Stream assert(Stream.ancestors.include?(Enumerable), "Stream doesn't mixin Enumerable") end |