derelict 0.5.2.travis.144 → 0.5.2.travis.146
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/derelict/box/manager.rb +1 -0
- data/spec/derelict/box/manager_spec.rb +31 -19
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MGY2NGFkNWNjMTBlMTUxOTUyMTE0NDhjYTE2NTEyOGVmZWNmZjE5OA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjI0NGE4Nzk1NzJiMGQ5ZTAyNzYzYTczY2JmMTE0OTNmNDFmMjUwMg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzI4N2I5ZTdiYTYyOTUyYmZmNmEyYjM5YTljNmMwYjg4YmJhNGUwMTBlZmY5
|
10
|
+
OWNhYjEwZWIyMWU2OTg2MmQ3YmQxN2YyZmEyNTYwNzA0YjgwMjJiZGU1NzJh
|
11
|
+
MDE3NjgxNGU1Y2M1ZWZlNWE3NWQzY2I5Y2M0MDlmMzZjNDViNGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
M2I4MWEyZDliODExNmJkYjY4NDc5NjE3N2Y4NGQ5MDE2NjVkZTBmODU5Nzc5
|
14
|
+
M2I3MjlmOTZmMjQyYWQyOWQwMzkxNzk5YzgzOTMzMjQ3OTQ2ODk0OGQ0MzRm
|
15
|
+
NWYyYjI2NjIzNmQ3MDBlZDdmMDllY2ZkMzc3MmRjZWVmNTYwNWQ=
|
data/lib/derelict/box/manager.rb
CHANGED
@@ -68,30 +68,42 @@ describe Derelict::Box::Manager do
|
|
68
68
|
let(:box_name) { double("box_name", :to_s => "test box") }
|
69
69
|
let(:source) { double("source", :to_s => "test source") }
|
70
70
|
let(:result) { double("result") }
|
71
|
-
|
71
|
+
let(:options) { {:log => log} }
|
72
|
+
subject { manager.add box_name, source, options }
|
72
73
|
|
73
|
-
|
74
|
-
|
75
|
-
|
74
|
+
context "with force disabled" do
|
75
|
+
before do
|
76
|
+
expect(instance).to receive(:execute!).with(:box, "add", box_name, source).and_yield("test", nil).and_return(result)
|
77
|
+
end
|
76
78
|
|
77
|
-
|
79
|
+
it { should be result }
|
78
80
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
81
|
+
context "with logging enabled" do
|
82
|
+
include_context "logged messages"
|
83
|
+
let(:expected_logs) {[
|
84
|
+
"DEBUG manager: Successfully initialized Derelict::Box::Manager for test instance\n",
|
85
|
+
" INFO manager: Adding box 'test box' from 'test source' using Derelict::Box::Manager for test instance\n",
|
86
|
+
" INFO external: test\n",
|
87
|
+
]}
|
88
|
+
end
|
89
|
+
|
90
|
+
context "with logging disabled" do
|
91
|
+
let(:log) { false }
|
92
|
+
include_context "logged messages"
|
93
|
+
let(:expected_logs) {[
|
94
|
+
"DEBUG manager: Successfully initialized Derelict::Box::Manager for test instance\n",
|
95
|
+
" INFO manager: Adding box 'test box' from 'test source' using Derelict::Box::Manager for test instance\n",
|
96
|
+
]}
|
97
|
+
end
|
86
98
|
end
|
87
99
|
|
88
|
-
context "with
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
100
|
+
context "with force enabled" do
|
101
|
+
before do
|
102
|
+
expect(instance).to receive(:execute!).with(:box, "add", box_name, source, "--force").and_return(result)
|
103
|
+
end
|
104
|
+
|
105
|
+
let(:options) { {:force => true} }
|
106
|
+
it { should be result }
|
95
107
|
end
|
96
108
|
end
|
97
109
|
|