rest_my_case 1.11.0 → 1.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rest_my_case/defense_attorney/base.rb +1 -0
- data/lib/rest_my_case/judge/base.rb +2 -0
- data/lib/rest_my_case/trial/case.rb +1 -1
- data/lib/rest_my_case/version.rb +1 -1
- data/spec/rest_my_case/base/required_context_spec.rb +8 -0
- data/spec/support/required_context.rb +20 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34b4504e3df6acbb8c22831dfb24851d6a7f2c5c
|
4
|
+
data.tar.gz: 1697d95e8a5982b48fc7ffeda931a4e0532982d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a944d96cb6a3523dcf6cd7223d2dccf917b86b476814e69616c265c1b800a5dd4eba758212c7cd5765b11c6dc4af9e9cdff68a0b0574bbb7bef141d88f7446f7
|
7
|
+
data.tar.gz: 40251630c342478270b19f2a6b28ef9cb881d2b19bf185a7be7e0a107c971a92422270f4a69ba9dabb332ba717ec4562213d5f59a5ab5bacedce94719c6a629e
|
data/lib/rest_my_case/version.rb
CHANGED
@@ -12,6 +12,14 @@ describe RestMyCase::Base do
|
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
+
context "When the required_context of a class fails, its dependencies shouldn't run" do
|
16
|
+
before { @context = RequiredContext::Users::Create.perform }
|
17
|
+
|
18
|
+
it "context dependencies should not have ran" do
|
19
|
+
expect(@context.current_user).to be nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
15
23
|
context "When dependencies also have a required_context" do
|
16
24
|
before { @context = RequiredContext::Posts::Update.perform }
|
17
25
|
|
@@ -6,9 +6,28 @@ module RequiredContext
|
|
6
6
|
:current_user
|
7
7
|
]
|
8
8
|
def setup
|
9
|
-
context.current_user =
|
9
|
+
context.current_user = OpenStruct.new
|
10
10
|
end
|
11
11
|
end
|
12
|
+
|
13
|
+
class BuildUser < RestMyCase::Base
|
14
|
+
def perform
|
15
|
+
context.current_user = OpenStruct.new context.current_user_attributes
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Save < RestMyCase::Base
|
20
|
+
def perform
|
21
|
+
context.current_user.save
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Create < RestMyCase::Base
|
26
|
+
depends BuildUser, Save
|
27
|
+
|
28
|
+
required_context \
|
29
|
+
:current_user
|
30
|
+
end
|
12
31
|
end
|
13
32
|
|
14
33
|
module Posts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rest_my_case
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goncalvesjoao
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|