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/parser/ini_spec.rb
Views: 11655
1
2
RSpec.describe Rex::Parser::Ini do
3
let(:ini_contents) { <<EOF
4
# global comment
5
global setting = blah
6
[foo]
7
a = b
8
[bar]
9
b = c
10
11
[baf]
12
c = d
13
EOF
14
}
15
16
let(:ini) { described_class.from_s(ini_contents) }
17
18
context "#each_group" do
19
it "enumerates the groups" do
20
groups = []
21
ini.each_group { |group| groups << group }
22
expect(groups).to eq(%w(foo bar baf))
23
end
24
end
25
26
context "#each_key" do
27
it "enumerates the groups" do
28
groups = []
29
ini.each_key.map { |group| groups << group }
30
expect(groups).to eq(%w(foo bar baf))
31
end
32
end
33
end
34
35