coaster 1.3.0 → 1.3.1
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 +4 -4
- data/lib/coaster/core_ext/standard_error.rb +1 -1
- data/lib/coaster/version.rb +1 -1
- data/test/test_standard_error.rb +24 -27
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08de549895f6dcc282235c7b9b885b92734b64d52b9bd431326d2da3ff2897fa'
|
4
|
+
data.tar.gz: 6f2f6444b1df9f5f706e8e6f0e9231eff50d5c0f1b5ca06fbf36634cceedb661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fe4efdc6253400dddcc0316e14e5b2a622b6771f6e4c9c2504b1b11aa6d2dfff82c851a7961acd9fc26d938b9474dd6222308a003f183eebb8a6049b00101e2
|
7
|
+
data.tar.gz: 05cf224109f2b6a8a136edee9093e683f75336a1b39a5cf276e59334a30161a12152505e3417aab50a619fc3383fc68f3e245e47e3687c32d5ed4c0e9eb881af
|
data/lib/coaster/version.rb
CHANGED
data/test/test_standard_error.rb
CHANGED
@@ -22,16 +22,16 @@ module Coaster
|
|
22
22
|
|
23
23
|
def test_standard_messages
|
24
24
|
e = StandardError.new('developer message')
|
25
|
-
assert_equal "standard error translation
|
26
|
-
assert_equal "standard error translation
|
25
|
+
assert_equal "standard error translation (developer message)", e.to_s
|
26
|
+
assert_equal "standard error translation (developer message)", e.message
|
27
27
|
assert_nil e.description
|
28
28
|
assert_nil e.desc
|
29
29
|
assert_equal 'standard error translation', e._translate
|
30
30
|
assert_equal 'standard error translation', e.user_message
|
31
31
|
assert_equal 'standard error title', e.title
|
32
32
|
e = StandardError.new(m: 'developer message', desc: 'user message')
|
33
|
-
assert_equal "user message
|
34
|
-
assert_equal "user message
|
33
|
+
assert_equal "user message (developer message)", e.to_s
|
34
|
+
assert_equal "user message (developer message)", e.message
|
35
35
|
assert_equal 'user message', e.description
|
36
36
|
assert_equal 'user message', e.desc
|
37
37
|
assert_equal 'user message', e._translate
|
@@ -41,16 +41,16 @@ module Coaster
|
|
41
41
|
|
42
42
|
def test_no_translation_class
|
43
43
|
e = UntitledError.new('developer message')
|
44
|
-
assert_equal "standard error translation
|
45
|
-
assert_equal "standard error translation
|
44
|
+
assert_equal "standard error translation (developer message)", e.to_s
|
45
|
+
assert_equal "standard error translation (developer message)", e.message
|
46
46
|
assert_nil e.description
|
47
47
|
assert_nil e.desc
|
48
48
|
assert_equal 'standard error translation', e._translate
|
49
49
|
assert_equal 'standard error translation', e.user_message
|
50
50
|
assert_equal 'standard error title', e.title
|
51
51
|
e = UntitledError.new(m: 'developer message', desc: 'user message')
|
52
|
-
assert_equal "user message
|
53
|
-
assert_equal "user message
|
52
|
+
assert_equal "user message (developer message)", e.to_s
|
53
|
+
assert_equal "user message (developer message)", e.message
|
54
54
|
assert_equal 'user message', e.description
|
55
55
|
assert_equal 'user message', e.desc
|
56
56
|
assert_equal 'user message', e._translate
|
@@ -60,40 +60,40 @@ module Coaster
|
|
60
60
|
|
61
61
|
def test_with_translation_class
|
62
62
|
e = SampleError.new
|
63
|
-
assert_equal "Test sample error
|
64
|
-
assert_equal "Test sample error
|
63
|
+
assert_equal "Test sample error (Coaster::TestStandardError::SampleError)", e.to_s
|
64
|
+
assert_equal "Test sample error (Coaster::TestStandardError::SampleError)", e.message
|
65
65
|
assert_nil e.description
|
66
66
|
assert_nil e.desc
|
67
67
|
assert_equal 'Test sample error', e._translate
|
68
68
|
assert_equal 'Test sample error', e.user_message
|
69
69
|
assert_equal 'Test this title', e.title
|
70
70
|
e = SampleError.new(beet: 'apple')
|
71
|
-
assert_equal "Test sample error
|
72
|
-
assert_equal "Test sample error
|
71
|
+
assert_equal "Test sample error (Coaster::TestStandardError::SampleError)", e.to_s
|
72
|
+
assert_equal "Test sample error (Coaster::TestStandardError::SampleError)", e.message
|
73
73
|
assert_nil e.description
|
74
74
|
assert_nil e.desc
|
75
75
|
assert_equal 'Test sample error', e._translate
|
76
76
|
assert_equal 'Test sample error', e.user_message
|
77
77
|
assert_equal 'Test this title', e.title
|
78
78
|
e = SampleError.new('developer message')
|
79
|
-
assert_equal "Test sample error
|
80
|
-
assert_equal "Test sample error
|
79
|
+
assert_equal "Test sample error (developer message)", e.to_s
|
80
|
+
assert_equal "Test sample error (developer message)", e.message
|
81
81
|
assert_nil e.description
|
82
82
|
assert_nil e.desc
|
83
83
|
assert_equal 'Test sample error', e._translate
|
84
84
|
assert_equal 'Test sample error', e.user_message
|
85
85
|
assert_equal 'Test this title', e.title
|
86
86
|
e = SampleError.new(m: 'developer message', desc: 'user message')
|
87
|
-
assert_equal "user message
|
88
|
-
assert_equal "user message
|
87
|
+
assert_equal "user message (developer message)", e.to_s
|
88
|
+
assert_equal "user message (developer message)", e.message
|
89
89
|
assert_equal 'user message', e.description
|
90
90
|
assert_equal 'user message', e.desc
|
91
91
|
assert_equal 'user message', e._translate
|
92
92
|
assert_equal 'user message', e.user_message
|
93
93
|
assert_equal 'Test this title', e.title
|
94
94
|
e = SampleError.new(tkey: 'sample.interpolation', value: 'blah')
|
95
|
-
assert_equal "Sample Interpolation blah
|
96
|
-
assert_equal "Sample Interpolation blah
|
95
|
+
assert_equal "Sample Interpolation blah (Coaster::TestStandardError::SampleError)", e.to_s
|
96
|
+
assert_equal "Sample Interpolation blah (Coaster::TestStandardError::SampleError)", e.message
|
97
97
|
assert_nil e.description
|
98
98
|
assert_nil e.desc
|
99
99
|
assert_equal 'Sample Interpolation blah', e._translate
|
@@ -104,7 +104,7 @@ module Coaster
|
|
104
104
|
def test_message
|
105
105
|
raise SampleError, {m: 'beer is proof'}
|
106
106
|
rescue => e
|
107
|
-
assert_equal "Test sample error
|
107
|
+
assert_equal "Test sample error (beer is proof)", e.message
|
108
108
|
end
|
109
109
|
|
110
110
|
def test_attributes
|
@@ -124,12 +124,12 @@ module Coaster
|
|
124
124
|
assert_equal 'Coaster::TestStandardError::ExampleError', e.to_hash['type']
|
125
125
|
assert_equal 20, e.to_hash['status']
|
126
126
|
assert_equal 500, e.to_hash['http_status']
|
127
|
-
assert_equal "Test example error
|
127
|
+
assert_equal "Test example error (Test sample error (#{SampleError.name}))", e.to_hash['message']
|
128
128
|
assert_equal 'rams', e.to_hash['cause']['frog']
|
129
129
|
assert_equal 'Coaster::TestStandardError::SampleError', e.to_hash['cause']['type']
|
130
130
|
assert_equal 10, e.to_hash['cause']['status']
|
131
131
|
assert_equal 500, e.to_hash['cause']['http_status']
|
132
|
-
assert_equal "Test sample error
|
132
|
+
assert_equal "Test sample error (Coaster::TestStandardError::SampleError)", e.to_hash['cause']['message']
|
133
133
|
end
|
134
134
|
|
135
135
|
def test_cause_attributes
|
@@ -153,9 +153,7 @@ module Coaster
|
|
153
153
|
rescue => e
|
154
154
|
detail = <<-LOG
|
155
155
|
[Coaster::TestStandardError::ExampleError] status:20
|
156
|
-
MESSAGE: Test example error
|
157
|
-
Test sample error
|
158
|
-
Coaster::TestStandardError::SampleError
|
156
|
+
MESSAGE: Test example error (Test sample error (Coaster::TestStandardError::SampleError))
|
159
157
|
@fingerprint: []
|
160
158
|
@tags: {}
|
161
159
|
@level: \"error\"
|
@@ -163,8 +161,7 @@ module Coaster
|
|
163
161
|
@tkey: nil
|
164
162
|
@raven: {}
|
165
163
|
CAUSE: [Coaster::TestStandardError::SampleError] status:10
|
166
|
-
MESSAGE: Test sample error
|
167
|
-
Coaster::TestStandardError::SampleError
|
164
|
+
MESSAGE: Test sample error (Coaster::TestStandardError::SampleError)
|
168
165
|
@fingerprint: []
|
169
166
|
@tags: {}
|
170
167
|
@level: \"error\"
|
@@ -213,7 +210,7 @@ LOG
|
|
213
210
|
begin
|
214
211
|
root_cause_sample3
|
215
212
|
rescue => e
|
216
|
-
assert_equal "standard error translation
|
213
|
+
assert_equal "standard error translation (a)", e.root_cause.message
|
217
214
|
end
|
218
215
|
end
|
219
216
|
|