@@ -46,12 +46,13 @@ describe("pcap_dump", function() {
4646 "binding" : pcapServiceMock
4747
4848 } ) ;
49-
50-
51- this . instance = pcap_dump . createPcapDumpSession ( ) ;
49+
5250 } ) ;
5351
5452 describe ( "#start should take the default values " , function ( ) {
53+ beforeEach ( function ( ) {
54+ this . instance = pcap_dump . createPcapDumpSession ( ) ;
55+ } ) ;
5556 it ( "buffer size should be 10485760 " , function ( ) {
5657 this . instance . start ( ) ;
5758 should ( this . instance . buffer_size ) . be . equal ( 10485760 ) ;
@@ -109,5 +110,29 @@ describe("pcap_dump", function() {
109110 } ) ;
110111
111112
113+ describe ( "#start should values given in " , function ( ) {
114+ beforeEach ( function ( ) {
115+ //(device_name, filter, buffer_size, outfile, packet_ready, is_monitor)
116+ this . instance = pcap_dump . createPcapDumpSession ( "eth1" , "dst" , 1000 , "" , "" , false ) ;
117+ } ) ;
118+ it ( "buffer size should be 1000 " , function ( ) {
119+ this . instance . start ( ) ;
120+ should ( this . instance . buffer_size ) . be . equal ( 1000 ) ;
121+ } ) ;
122+ it ( "findalldevs should return the arrayy " , function ( ) {
123+ this . instance . start ( ) ;
124+ var devices = pcap_dump . findalldevs ( ) ;
125+ should ( devices [ 0 ] ) . be . equal ( "en0" ) ;
126+ should ( devices [ 1 ] ) . be . equal ( "eth0" ) ;
127+
128+ } ) ;
129+
130+
131+
132+
133+
134+ } ) ;
135+
136+
112137
113138} ) ;
0 commit comments