rest_my_case 1.11.1 → 1.11.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: 34b4504e3df6acbb8c22831dfb24851d6a7f2c5c
4
- data.tar.gz: 1697d95e8a5982b48fc7ffeda931a4e0532982d1
3
+ metadata.gz: fe38b660d35df2e2dec83374863b36ed20da5daf
4
+ data.tar.gz: 5f21b8a28eac1f8445edcb018b248ca1135adef2
5
5
  SHA512:
6
- metadata.gz: a944d96cb6a3523dcf6cd7223d2dccf917b86b476814e69616c265c1b800a5dd4eba758212c7cd5765b11c6dc4af9e9cdff68a0b0574bbb7bef141d88f7446f7
7
- data.tar.gz: 40251630c342478270b19f2a6b28ef9cb881d2b19bf185a7be7e0a107c971a92422270f4a69ba9dabb332ba717ec4562213d5f59a5ab5bacedce94719c6a629e
6
+ metadata.gz: 8717ffd4ad841b7a953ee6ee0cc2d963629ee012c911968044f0da436bf6be50baf5cc90a821b37a11a8883668ce979684f9145e81f83fea6833edf0734ff9c4
7
+ data.tar.gz: 684501bd0353d6969d38507dbd4b254468f4867cb2966ca138e497ddb774182916dcac4a8d35d4999cd46a5c6453305587984634750b7b50e0bd8c4f70802682
@@ -6,10 +6,15 @@ module RestMyCase
6
6
 
7
7
  include Status
8
8
 
9
- def self.included(parent_class)
10
- return unless parent_class.respond_to? :trial_court
9
+ module ClassMethods
10
+ def trial_court
11
+ @trial_court ||= Trial::Court.new \
12
+ Judge::Base, DefenseAttorney::Base, Base, Context::HttpStatus
13
+ end
14
+ end
11
15
 
12
- parent_class.trial_court.context_class = Context::HttpStatus
16
+ def self.included(parent_class)
17
+ parent_class.extend ClassMethods
13
18
  end
14
19
 
15
20
  end
@@ -4,10 +4,15 @@ module RestMyCase
4
4
 
5
5
  module Status
6
6
 
7
- def self.included(parent_class)
8
- return unless parent_class.respond_to? :trial_court
7
+ module ClassMethods
8
+ def trial_court
9
+ @trial_court ||= Trial::Court.new \
10
+ Judge::Base, DefenseAttorney::Base, Base, Context::Status
11
+ end
12
+ end
9
13
 
10
- parent_class.trial_court.context_class = Context::Status
14
+ def self.included(parent_class)
15
+ parent_class.extend ClassMethods
11
16
  end
12
17
 
13
18
  def status
@@ -1,5 +1,5 @@
1
1
  module RestMyCase
2
2
 
3
- VERSION = '1.11.1'
3
+ VERSION = '1.11.2'
4
4
 
5
5
  end
@@ -53,4 +53,18 @@ describe RestMyCase::HttpStatus do
53
53
  end
54
54
  end
55
55
 
56
+ context "When a class inherits from another" do
57
+ HttpStatusTestCase1 = Class.new(RestMyCase::Base) do
58
+ include RestMyCase::HttpStatus
59
+ end
60
+
61
+ HttpStatusTestCase2 = Class.new(HttpStatusTestCase1)
62
+
63
+ before { @context = HttpStatusTestCase2.perform }
64
+
65
+ it "context should be Context::HttpStatus" do
66
+ expect(@context.class).to be RestMyCase::Context::HttpStatus
67
+ end
68
+ end
69
+
56
70
  end
@@ -163,6 +163,20 @@ describe RestMyCase::Status do
163
163
  end
164
164
  end
165
165
 
166
+ context "When a class inherits from another" do
167
+ StatusTestCase7 = Class.new(RestMyCase::Base) do
168
+ include RestMyCase::Status
169
+ end
170
+
171
+ StatusTestCase8 = Class.new(StatusTestCase7)
172
+
173
+ before { @context = StatusTestCase8.perform }
174
+
175
+ it "context should be Context::Status" do
176
+ expect(@context.class).to be RestMyCase::Context::Status
177
+ end
178
+ end
179
+
166
180
  end
167
181
 
168
182
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest_my_case
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.1
4
+ version: 1.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - goncalvesjoao