CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/spec/lib/rex/proto/kademlia/ping_spec.rb
Views: 11789
1
# -*- coding: binary -*-
2
3
require 'spec_helper'
4
5
RSpec.describe Rex::Proto::Kademlia::Ping do
6
subject(:ping) do
7
described_class.new
8
end
9
10
describe '#initialize' do
11
it 'constructs properly' do
12
expect(ping.type).to eq(Rex::Proto::Kademlia::PING)
13
expect(ping.body).to eq('')
14
end
15
end
16
17
describe '#to_str' do
18
it 'packs properly' do
19
expect(ping.to_str).to eq("\xE4\x60")
20
end
21
end
22
end
23
24