cooperator 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cooperator/version.rb +1 -1
- data/lib/cooperator.rb +1 -1
- data/spec/perform.rb +32 -3
- 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: 1126a977ce9e418bcf524f6eb304c3442412cd7d
|
4
|
+
data.tar.gz: 7a73e69cb3ad4f3b38f0f38a4de4bde779f5b51f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1763de19405d4de874dc86bceaea2700cc23dee9473d0fa853d63aead6eef65a8fa3e05bf11e912f1da0905a0fd74acbcba36cfdde71299599808aee1fe3fb7
|
7
|
+
data.tar.gz: 6a8ee780dee4c7b2542f77562360d7e6ca707d619333e505a18b5867bc2e4c99f5f67710ab3742457a4cc1f0eb8d0abd9cc881d2d6577846997d61bfde05b8dd
|
data/lib/cooperator/version.rb
CHANGED
data/lib/cooperator.rb
CHANGED
@@ -57,7 +57,7 @@ module Cooperator
|
|
57
57
|
end
|
58
58
|
|
59
59
|
committed.each do |property|
|
60
|
-
raise Exception, "missing committed property: #{property}" unless context.include? property
|
60
|
+
raise Exception, "missing committed property: #{property}" unless action.context.include? property
|
61
61
|
end
|
62
62
|
|
63
63
|
action.context
|
data/spec/perform.rb
CHANGED
@@ -1,22 +1,51 @@
|
|
1
1
|
require 'cooperator'
|
2
2
|
|
3
|
-
class
|
3
|
+
class Expects
|
4
4
|
prepend Cooperator
|
5
5
|
|
6
6
|
expects :input
|
7
|
+
|
8
|
+
def perform
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class CommitsWithoutCommit
|
13
|
+
prepend Cooperator
|
14
|
+
|
7
15
|
commits :output
|
16
|
+
|
17
|
+
def perform
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class CommitsWithCommit
|
22
|
+
prepend Cooperator
|
23
|
+
|
24
|
+
commits :output
|
25
|
+
|
26
|
+
def perform
|
27
|
+
commit output: 'Output'
|
28
|
+
end
|
8
29
|
end
|
9
30
|
|
10
31
|
scope '.perform' do
|
11
32
|
spec 'raises an exception when an expected input is missing' do
|
12
33
|
raises Exception do
|
13
|
-
|
34
|
+
Expects.perform
|
14
35
|
end
|
15
36
|
end
|
16
37
|
|
38
|
+
spec 'runs when an expected input exists' do
|
39
|
+
Expects.perform input: 'Input'
|
40
|
+
end
|
41
|
+
|
17
42
|
spec 'raises an exception when a committed output is missing' do
|
18
43
|
raises Exception do
|
19
|
-
|
44
|
+
CommitsWithoutCommit.perform
|
20
45
|
end
|
21
46
|
end
|
47
|
+
|
48
|
+
spec 'runs when a committed output exists' do
|
49
|
+
CommitsWithCommit.perform
|
50
|
+
end
|
22
51
|
end
|