cooperator 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd639f42458a575db4b58329a67b20c989540f1f
4
- data.tar.gz: bbdaebba6ac71a33832956b1d84c4044abe2c643
3
+ metadata.gz: 1126a977ce9e418bcf524f6eb304c3442412cd7d
4
+ data.tar.gz: 7a73e69cb3ad4f3b38f0f38a4de4bde779f5b51f
5
5
  SHA512:
6
- metadata.gz: 5d9e7ca38cfe217b3364ac460ffa61fb70905cfd108af51e7e45ed176f556e14f6c9057fd3283419fb52541716e74024dbc94e9978d35b849f8c2854b418118e
7
- data.tar.gz: ad07830f21a26cee8ccdce29ea79ad478378e4164640ebc5e493d163f4f8eb28185d695c2fccf6675b13c8b9c825a7dab9c5cce600ecf8153e57efcc88c2195f
6
+ metadata.gz: b1763de19405d4de874dc86bceaea2700cc23dee9473d0fa853d63aead6eef65a8fa3e05bf11e912f1da0905a0fd74acbcba36cfdde71299599808aee1fe3fb7
7
+ data.tar.gz: 6a8ee780dee4c7b2542f77562360d7e6ca707d619333e505a18b5867bc2e4c99f5f67710ab3742457a4cc1f0eb8d0abd9cc881d2d6577846997d61bfde05b8dd
@@ -1,3 +1,3 @@
1
1
  module Cooperator
2
- VERSION = '0.2.3'
2
+ VERSION = '0.2.4'
3
3
  end
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 Interactor
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
- Interactor.perform
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
- Interactor.perform
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cooperator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erol Fornoles