toque 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/toque/helpers.rb +4 -1
- data/lib/toque/version.rb +1 -1
- data/spec/toque/helpers_spec.rb +15 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e731ee8504df30f8ad85efbd8235ebe23ad1548a
|
4
|
+
data.tar.gz: 52187cfc3e09a96d524cb15dca1f5ef6cb373aef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4869364d22d99093ec11a8aed5c15db576a903e368ac58203cfe46e90867f7fb9c8ee31946b471637e009734a956b0deed72ce9904d719f92e908acc0f36fd7
|
7
|
+
data.tar.gz: 2301bdee31eafc80c1f0c7c326b48601dc2e526a68554d36649de92ff964e89cb138f79f7e13619185184ccf2cb1673879644acb1d2c3bce4c5bb55456c91c6b
|
data/lib/toque/helpers.rb
CHANGED
data/lib/toque/version.rb
CHANGED
data/spec/toque/helpers_spec.rb
CHANGED
@@ -27,13 +27,26 @@ describe Toque::Helpers, 'loaded into capistrano' do
|
|
27
27
|
|
28
28
|
describe '#curl?' do
|
29
29
|
it 'return true if curl exists' do
|
30
|
-
@configuration.stub_command 'curl
|
30
|
+
@configuration.stub_command 'curl', data: "curl: try 'curl --help' or 'curl --manual' for more information"
|
31
31
|
expect(@configuration.toque.curl?).to be_true
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'return false if curl is missing' do
|
35
|
-
@configuration.stub_command 'curl
|
35
|
+
@configuration.stub_command 'curl', fail: true
|
36
36
|
expect(@configuration.toque.curl?).to be_false
|
37
37
|
end
|
38
38
|
end
|
39
|
+
|
40
|
+
describe '#require_curl' do
|
41
|
+
it 'should install curl if not present' do
|
42
|
+
@configuration.stub_command 'curl', fail: true
|
43
|
+
@configuration.stub_command "sudo -p 'sudo password: ' apt-get install --no-install-recommends -yq curl" do |_|
|
44
|
+
@configuration.stub_command 'curl', data: "curl: try 'curl --help' or 'curl --manual' for more information"
|
45
|
+
end
|
46
|
+
|
47
|
+
expect(@configuration.toque.curl?).to be_false
|
48
|
+
@configuration.toque.require_curl
|
49
|
+
expect(@configuration.toque.curl?).to be_true
|
50
|
+
end
|
51
|
+
end
|
39
52
|
end
|