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/bootstrap_request_spec.rb
Views: 11788
1
# -*- coding: binary -*-
2
3
require 'spec_helper'
4
5
RSpec.describe Rex::Proto::Kademlia::BootstrapRequest do
6
subject(:bootstrap) do
7
described_class.new
8
end
9
10
describe '#initialize' do
11
it 'constructs properly' do
12
expect(bootstrap.type).to eq(Rex::Proto::Kademlia::BOOTSTRAP_REQUEST)
13
expect(bootstrap.body).to eq('')
14
end
15
end
16
17
describe '#to_str' do
18
it 'packs properly' do
19
expect(bootstrap.to_str).to eq("\xE4\x01")
20
end
21
end
22
end
23
24