4 class StreamTest < Test::Unit::TestCase
6 stream = Eet::Stream.new
7 stream << Eet::Chunk.new("tag", "foo")
8 stream << Eet::Chunk.new("tag2", "bar")
9 stream << Eet::Chunk.new("tag23", "baz")
16 assert_equal("CHnK\007\0\0\0tag\0foo" +
17 "CHnK\010\0\0\0tag2\0bar" +
18 "CHnK\011\0\0\0tag23\0baz", @data)
24 assert_nothing_raised do
25 stream = Eet::Stream.deserialize(@data)
28 assert_equal(3, stream.length)
30 values = {"tag" => "foo", "tag2" => "bar", "tag23" => "baz"}
32 found = stream.find { |c| c.tag == k }
33 assert_not_nil(found, "chunk not found - #{k}")
34 assert_equal(found.data, v)
38 assert_equal([], stream)