Class: Mu::Xtractr::Field::Test::Value::Test
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- Mu::Xtractr::Field::Test::Value::Test
- Defined in:
- lib/mu/xtractr/test/tc_field.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#xtractr ⇒ Object
readonly
Returns the value of attribute xtractr.
Instance Method Summary collapse
- #setup ⇒ Object
- #test_count ⇒ Object
- #test_each_packet ⇒ Object
- #test_inspect ⇒ Object
- #test_packets ⇒ Object
- #test_q ⇒ Object
- #test_sum ⇒ Object
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
96 97 98 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 96 def value @value end |
#xtractr ⇒ Object (readonly)
Returns the value of attribute xtractr.
95 96 97 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 95 def xtractr @xtractr end |
Instance Method Details
#setup ⇒ Object
98 99 100 101 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 98 def setup @xtractr = Xtractr.new @value = xtractr.field('dns.qry.name').values.first end |
#test_count ⇒ Object
118 119 120 121 122 123 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 118 def test_count value.count('pkt.src').each do |c| assert_kind_of(Views::Count, c) assert_equal('pkt.src', c.field.name) end end |
#test_each_packet ⇒ Object
113 114 115 116 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 113 def test_each_packet v = value.each_packet { |pkt| assert_kind_of(Packet, pkt) } assert_equal(value, v) end |
#test_inspect ⇒ Object
132 133 134 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 132 def test_inspect assert_nothing_raised { value.inspect } end |
#test_packets ⇒ Object
107 108 109 110 111 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 107 def test_packets packets = value.packets assert_kind_of(Packets, packets) assert_equal('dns.qry.name:"ax.search.itunes.apple.com"', packets.q) end |
#test_q ⇒ Object
103 104 105 |
# File 'lib/mu/xtractr/test/tc_field.rb', line 103 def test_q assert_equal('dns.qry.name:"ax.search.itunes.apple.com"', value.q) end |