rest_my_case 1.11.4 → 1.11.5

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: 1f633d11371360495dfae4b50cdc8a79e0540df6
4
- data.tar.gz: ba3f4c4077ca1e25d26298e501a0fab71384ccb3
3
+ metadata.gz: 4c5660e340fca5a2c72493838b568106de58b8b7
4
+ data.tar.gz: 6cdf81465f94361d5a360032a7bd7e7886846685
5
5
  SHA512:
6
- metadata.gz: b86dc58287e72ac1728910197c7b97022d5778caa73b188113e4156e1def90d63cf0e82942e3e19ce85353bdc4a5d7cb8e9d2106e7ef1b0ee4a5f0659bf3ea08
7
- data.tar.gz: c85409908e15e15010ea5f9afc6e33ec4ffe2907eec71b80374f954c87854462007c1df4b8681a66b33fd2ecb2cda1e230ab5f3c4ebd9f2b3bc803b178799a55
6
+ metadata.gz: fd3046f196683afef78a77e4dd3e0f67db3f035ab5f6f6ab0888546a42ee47e47606fd963608c45efc8f443c37157522d5647267a4269a52fcdf435a5c9e5078
7
+ data.tar.gz: 4f9f36ef7279fc9f354a09cd7b75d530a329bf8d09764185f5e1c9169466990134d6a67a397ed952ba32ad248cd47f9138ef8a5f994a9560292a6052a0feba17
@@ -10,11 +10,13 @@ module RestMyCase
10
10
  end
11
11
 
12
12
  def self.required_context(*schema)
13
+ @required_context_schema = schema
14
+
13
15
  if schema.length == 1 && (schema[0].is_a?(Hash) || schema[0].is_a?(Array))
14
16
  @required_context_schema = schema[0]
15
- else
16
- @required_context_schema = schema
17
17
  end
18
+
19
+ @required_context_schema.each { |context_key| context_reader context_key }
18
20
  end
19
21
 
20
22
  def self.required_context_schema
@@ -1,5 +1,5 @@
1
1
  module RestMyCase
2
2
 
3
- VERSION = '1.11.4'
3
+ VERSION = '1.11.5'
4
4
 
5
5
  end
@@ -10,6 +10,11 @@ describe RestMyCase::Base do
10
10
  it "context should be ok" do
11
11
  expect(@context.ok?).to be true
12
12
  end
13
+
14
+ it "use_case instance should have a delegating method to that required_context" do
15
+ use_case = RequiredContext::Users::GetCurrentUser.new({})
16
+ expect(use_case).to respond_to(:current_user)
17
+ end
13
18
  end
14
19
 
15
20
  context "When the required_context of a class fails, its dependencies shouldn't run" do
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
4
+ version: 1.11.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - goncalvesjoao
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-13 00:00:00.000000000 Z
11
+ date: 2016-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry