Class: Capp::TestCase

Inherits:
MiniTest::Unit::TestCase
  • Object
show all
Defined in:
lib/capp/test_case.rb

Overview

Capp::TestCase contains some useful methods for testing parts of Capp.

The _DUMP constants are created from pcap files in the test directory. You can create your own capture from tcpdump:

tcpdump -r test/my.pcap [your specific capture arguments]

Constant Summary collapse

ARP_DUMP =

An ARP packet

File.expand_path '../../../test/arp.pcap',    __FILE__
EAP_802_1X_DUMP =

An EAP 802.1X packet

File.expand_path '../../../test/802.1X.pcap', __FILE__
ICMP4_DUMP =

An ICMPv4 packet

File.expand_path '../../../test/icmp4.pcap',  __FILE__
ICMP6_DUMP =

An ICMPv6 packet

File.expand_path '../../../test/icmp6.pcap',  __FILE__
TCP4_DUMP =

A TCPv4 packet

File.expand_path '../../../test/tcp4.pcap',   __FILE__
TCP6_DUMP =

A TCPv6 packet

File.expand_path '../../../test/tcp6.pcap',   __FILE__
UDP4_DUMP =

A UDPv4 packet

File.expand_path '../../../test/udp4.pcap',   __FILE__
UDP6_DUMP =

A UDPv6 packet

File.expand_path '../../../test/udp6.pcap',   __FILE__

Instance Method Summary collapse

Instance Method Details

#packet(dump) ⇒ Object

Returns the first packet in dump



56
57
58
# File 'lib/capp/test_case.rb', line 56

def packet dump
  Capp.offline(dump).loop.first
end