We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07767cd commit f37adf9Copy full SHA for f37adf9
spec/lib/rex/parser/ini_spec.rb
@@ -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
26
27
+ context "#each_key" do
28
29
30
+ ini.each_key.map { |group| groups << group }
31
32
33
34
+end
0 commit comments