Skip to content

Commit f37adf9

Browse files
committed
Add incomplete spec for Rex::Parser::Ini
1 parent 07767cd commit f37adf9

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

spec/lib/rex/parser/ini_spec.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
require 'rex/parser/ini'
2+
3+
describe Rex::Parser::Ini do
4+
let(:ini_contents) { <<EOF
5+
# global comment
6+
global settting = blah
7+
[foo]
8+
a = b
9+
[bar]
10+
b = c
11+
12+
[baf]
13+
c = d
14+
EOF
15+
}
16+
17+
let(:ini) { described_class.from_s(ini_contents) }
18+
19+
context "#each_group" do
20+
it "enumerates the groups" do
21+
groups = []
22+
ini.each_group { |group| groups << group }
23+
groups.should eq(%w(foo bar baf))
24+
end
25+
end
26+
27+
context "#each_key" do
28+
it "enumerates the groups" do
29+
groups = []
30+
ini.each_key.map { |group| groups << group }
31+
groups.should eq(%w(foo bar baf))
32+
end
33+
end
34+
end

0 commit comments

Comments
 (0)