minitest-capistrano 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/minitest/capistrano.rb +13 -0
- data/lib/minitest/capistrano/version.rb +1 -1
- data/spec/minitest_capistrano_spec.rb +23 -0
- metadata +6 -6
data/lib/minitest/capistrano.rb
CHANGED
@@ -78,6 +78,19 @@ module MiniTest
|
|
78
78
|
def uploads
|
79
79
|
@uploads ||= {}
|
80
80
|
end
|
81
|
+
|
82
|
+
def capture(command, options={})
|
83
|
+
captures[command] = {:options => options}
|
84
|
+
captures_responses[command]
|
85
|
+
end
|
86
|
+
|
87
|
+
def captures
|
88
|
+
@captures ||= {}
|
89
|
+
end
|
90
|
+
|
91
|
+
def captures_responses
|
92
|
+
@captures_responses ||= {}
|
93
|
+
end
|
81
94
|
end
|
82
95
|
end
|
83
96
|
end
|
@@ -46,6 +46,29 @@ describe MiniTest::Capistrano::ConfigurationExtension do
|
|
46
46
|
@config.uploads["path_to"].wont_be_nil
|
47
47
|
end
|
48
48
|
end
|
49
|
+
|
50
|
+
describe "#capture" do
|
51
|
+
it "starts with an empty hash" do
|
52
|
+
@config.captures.must_be_empty
|
53
|
+
end
|
54
|
+
|
55
|
+
it "adds an entry to the hash when called" do
|
56
|
+
@config.captures.must_be_empty
|
57
|
+
@config.capture "cat /tmp/secrets.txt"
|
58
|
+
@config.captures.wont_be_empty
|
59
|
+
@config.captures["cat /tmp/secrets.txt"].wont_be_nil
|
60
|
+
end
|
61
|
+
|
62
|
+
it "retuns a nil response if one is not pre-set" do
|
63
|
+
@config.capture("cat /nope").must_be_nil
|
64
|
+
end
|
65
|
+
|
66
|
+
it "returns a response if one is pre-set" do
|
67
|
+
@config.captures_responses["cat /tmp/file"] = "blah bleh"
|
68
|
+
|
69
|
+
@config.capture("cat /tmp/file").must_equal "blah bleh"
|
70
|
+
end
|
71
|
+
end
|
49
72
|
end
|
50
73
|
|
51
74
|
describe MiniTest::Assertions do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-capistrano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
16
|
-
requirement: &
|
16
|
+
requirement: &70145221461000 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.10.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70145221461000
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: capistrano
|
27
|
-
requirement: &
|
27
|
+
requirement: &70145221459740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '2.9'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70145221459740
|
36
36
|
description: MiniTest assertions and expectations for testing Capistrano recipes
|
37
37
|
email:
|
38
38
|
- fnichol@nichol.ca
|