FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
node_pcap/spec/decode/decode.js at master · gitqueue/node_pcap · GitHub
gitqueue
/
node_pcap
Public
forked from
node-pcap/node_pcap
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
node_pcap
/
spec
/
decode
/
decode.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (23 loc) · 866 Bytes
Breadcrumbs
node_pcap
/
spec
/
decode
/
decode.js
Copy path
File metadata and controls
27 lines (23 loc) · 866 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var
should
=
require
(
"should"
)
;
var
sinon
=
require
(
"sinon"
)
;
exports
.
shouldBehaveLikeADecoder
=
function
(
decoderName
,
raisesEvent
)
{
it
(
"is a function"
,
function
(
)
{
this
.
instance
.
decode
.
should
.
be
.
type
(
"function"
)
;
}
)
;
it
(
"returns the instance"
,
function
(
)
{
var
result
=
this
.
instance
.
decode
(
this
.
example
,
0
,
this
.
example
.
length
)
;
should
(
result
)
.
be
.
exactly
(
this
.
instance
)
;
}
)
;
if
(
raisesEvent
)
{
it
(
"raises a "
+
decoderName
+
" event on decode"
,
function
(
)
{
// This is a bit of a special case so we need
// to rewire some of the variables used in
// other tests.
var
eventHandler
=
sinon
.
spy
(
)
;
this
.
eventEmitter
.
on
(
this
.
instance
.
decoderName
,
eventHandler
)
;
// Decode
this
.
instance
.
decode
(
this
.
example
,
0
,
this
.
example
.
length
)
;
eventHandler
.
callCount
.
should
.
be
.
exactly
(
1
)
;
}
)
;
}
}
;
Back
|
FazBrowse Home
|
New Git URL