cooperator 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3c4488b6b7b963727bdc7fd71b29fed2a6a689df
4
- data.tar.gz: ba79736c55a012ae4c9e388cf686615a3d5d2de8
3
+ metadata.gz: 92514ccba0d6cd8eba54cfb1ed6b674da68b0e1d
4
+ data.tar.gz: 5e36f0a442b5e6e67e452994a2dbadb9388ca542
5
5
  SHA512:
6
- metadata.gz: 6955b1fcd5dd16d7a52b5ceb5533188c597e1753a3c0390a2f63a7b1cff94776d41fd567488614fa60e69ee201e34fcbb3eb6025aa5c13412f827a37b690c24d
7
- data.tar.gz: 8795e69ff4dda864bb1af0adbad1b91efeb058b1fb56c6e0b4c28f6123a44dc11d9777507b682afc06e557409b4eec3cef22131edbdc4aad85774894ed949466
6
+ metadata.gz: 9ec7b8b5db064b39a54ee47dee4751c586f7592ba6d14abd23f2294219bd85aa31f5744af01a9c616addabc4e3a7ac06db6299e794ac3d315c671042054ecbb0
7
+ data.tar.gz: 41e688708acd72c321679e3c509f0f8c0067ce9d0b94be2359289c016d4412594378725e2ca52e9935465897fadce5b635500c10981cb72b072dab2f857ab327
@@ -1,3 +1,3 @@
1
1
  module Cooperator
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
data/lib/cooperator.rb CHANGED
@@ -45,8 +45,8 @@ module Cooperator
45
45
  throw :_finish
46
46
  end
47
47
 
48
- def failure!
49
- context.failure!
48
+ def failure!(messages = {})
49
+ context.failure! messages
50
50
  throw :_finish
51
51
  end
52
52
 
data/spec/cooperator.rb CHANGED
@@ -45,3 +45,12 @@ spec 'delegate to the current context' do
45
45
 
46
46
  assert interactor.name, :==, 'Apple'
47
47
  end
48
+
49
+ spec '#failure! accepts an error key and message' do
50
+ context = Cooperator::Context.new
51
+ interactor = Interactor.new context
52
+
53
+ interactor.failure! action: 'Failure!'
54
+
55
+ assert context.errors, :==, action: ['Failure!']
56
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cooperator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erol Fornoles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler