rest_my_case 1.10.2 → 1.10.3

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: 22f267e935ce86030f76045e80be9f8f1b8a7cbe
4
- data.tar.gz: 51ce1a78e1e386272b6e564faa67528415c0e4ca
3
+ metadata.gz: 28c6ce0aa9e0246531b69a639059a556a76971ea
4
+ data.tar.gz: 101e9695b6cc2218132ebb08047b5f165d748428
5
5
  SHA512:
6
- metadata.gz: 77014d8144587425b18aaf490cfcd9260fc82cc0d714b2e957587c74701abb5e05d7629ac322993a522e148ae6ff9ff9ba9aeb59cd8d72c2839fc218b806a63e
7
- data.tar.gz: dc2258b1525f0e8285fccf1fbb738e36814432a669fdd0a1c2cccb9c84cad957d9d229a1ea3a257282f0717754f7ceaf69abe79c5bdd34b3f3b9d028bcc7d2db
6
+ metadata.gz: c7c421368fdfb10d6e021b51c661ba5087635cbfe0070cb5d7d46887ad924cd1a11587786b6298d8e6c7ab40ebff8a179c38e719853a59088d320276b1cdaa07
7
+ data.tar.gz: 48a1ebff33fa391e87933e0a844634064117ad7632f417365b42408feac0a10ce6489ed3b964094aaf750b119e39ed25886e3e312155a861f3de67cf93eafa39
@@ -9,10 +9,6 @@ module RestMyCase
9
9
  Judge::Base, DefenseAttorney::Base, RestMyCase::Base, Context::Base
10
10
  end
11
11
 
12
- def self.trial_court=(new_trial_court)
13
- @trial_court = new_trial_court
14
- end
15
-
16
12
  def self.depends(*use_case_classes)
17
13
  dependencies.push(*use_case_classes)
18
14
  end
@@ -9,6 +9,11 @@ module RestMyCase
9
9
  def add(error)
10
10
  super
11
11
 
12
+ if error[:status].nil? && error[:message]
13
+ error[:status] = error[:message]
14
+ error[:message] = nil
15
+ end
16
+
12
17
  @context.status.send("#{error[:status]}!")
13
18
 
14
19
  @last_known_error = error
@@ -1,5 +1,5 @@
1
1
  module RestMyCase
2
2
 
3
- VERSION = '1.10.2'
3
+ VERSION = '1.10.3'
4
4
 
5
5
  end
@@ -34,20 +34,20 @@ describe RestMyCase::Status do
34
34
 
35
35
  before { @context = StatusTestCase2.perform }
36
36
 
37
- it "@context.status.unprocessable_entity? should be false" do
38
- expect(@context.status.unprocessable_entity?).to be false
37
+ it "@context.status.unprocessable_entity? should be true" do
38
+ expect(@context.status.unprocessable_entity?).to be true
39
39
  end
40
40
 
41
41
  it "@context.next_line should be true" do
42
42
  expect(@context.next_line).to be true
43
43
  end
44
44
 
45
- it "@context.status.ok? should be true" do
46
- expect(@context.status.ok?).to be true
45
+ it "@context.status.ok? should be false" do
46
+ expect(@context.status.ok?).to be false
47
47
  end
48
48
 
49
49
  it "context's errors should have a proper message" do
50
- expect(@context.errors).to match [a_hash_including({ message: :unprocessable_entity, class_name: "StatusTestCase2" })]
50
+ expect(@context.errors).to match [a_hash_including({ status: :unprocessable_entity, message: nil, class_name: "StatusTestCase2" })]
51
51
  end
52
52
  end
53
53
 
@@ -62,20 +62,20 @@ describe RestMyCase::Status do
62
62
 
63
63
  before { @context = StatusTestCase3.perform }
64
64
 
65
- it "@context.status.internal_server_error? should be false" do
66
- expect(@context.status.internal_server_error?).to be false
65
+ it "@context.status.internal_server_error? should be true" do
66
+ expect(@context.status.internal_server_error?).to be true
67
67
  end
68
68
 
69
69
  it "@context.next_line should raise an error" do
70
70
  expect { context.next_line }.to raise_error
71
71
  end
72
72
 
73
- it "@context.status.ok? should be true" do
74
- expect(@context.status.ok?).to be true
73
+ it "@context.status.ok? should be false" do
74
+ expect(@context.status.ok?).to be false
75
75
  end
76
76
 
77
77
  it "context's errors should have a proper message" do
78
- expect(@context.errors).to match [a_hash_including({ message: :internal_server_error, class_name: "StatusTestCase3" })]
78
+ expect(@context.errors).to match [a_hash_including({ status: :internal_server_error, message: nil, class_name: "StatusTestCase3" })]
79
79
  end
80
80
  end
81
81
 
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.10.2
4
+ version: 1.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - goncalvesjoao