File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 18
18
subject [ "FoO" ] . should == "bar"
19
19
subject [ "foO" ] . should == "bar"
20
20
end
21
+ context "#to_h" do
22
+ it "should return a Hash with correct values" do
23
+ subject . to_h . should == { "foo" => "bar" , "fizz" => "buzz" }
24
+ end
25
+ end
21
26
end
22
27
23
28
describe Msf ::DataStore do
24
29
30
+ describe "#import_option" do
31
+ subject do
32
+ s = described_class . new
33
+ s . import_option ( "foo" , "bar" )
34
+ s . import_option ( "fizz" , "buzz" )
35
+ s
36
+ end
37
+ it_behaves_like "datastore"
38
+ end
39
+
25
40
describe "#import_options_from_hash" do
26
41
subject do
27
42
hash = { "foo" => "bar" , "fizz" => "buzz" }
42
57
it_behaves_like "datastore"
43
58
end
44
59
60
+ describe "#from_file" do
61
+ subject do
62
+ ini_instance = double
63
+ ini_instance . stub ( :group? ) . and_return ( true )
64
+ ini_instance . stub ( :[] ) . and_return ( { "foo" => "bar" , "fizz" => "buzz" } )
65
+
66
+ ini = stub_const ( "Rex::Parser::Ini" , Class . new )
67
+ ini . stub ( :from_file ) . and_return ( ini_instance )
68
+
69
+ s = described_class . new
70
+ s . from_file ( "path" )
71
+ s
72
+ end
73
+
74
+ it_behaves_like "datastore"
75
+ end
76
+
77
+
45
78
end
You can’t perform that action at this time.
0 commit comments