deas 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/deas/show_exceptions.rb +3 -6
- data/lib/deas/version.rb +1 -1
- data/test/unit/show_exceptions_tests.rb +3 -4
- metadata +4 -4
data/lib/deas/show_exceptions.rb
CHANGED
@@ -34,12 +34,9 @@ module Deas
|
|
34
34
|
end
|
35
35
|
|
36
36
|
class Body
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
def content
|
42
|
-
@content ||= "#{@error.class}: #{@error.message}\n#{@error.backtrace.join("\n")}"
|
37
|
+
attr_reader :content
|
38
|
+
def initialize(e)
|
39
|
+
@content ||= "#{e.class}: #{e.message}\n#{(e.backtrace || []).join("\n")}"
|
43
40
|
end
|
44
41
|
|
45
42
|
def size
|
data/lib/deas/version.rb
CHANGED
@@ -7,11 +7,10 @@ class Deas::ShowExceptions
|
|
7
7
|
class BaseTests < Assert::Context
|
8
8
|
desc "Deas::ShowExceptions"
|
9
9
|
setup do
|
10
|
-
exception =
|
11
|
-
begin; raise 'test'; rescue Exception => exception; end
|
10
|
+
exception = Sinatra::NotFound.new
|
12
11
|
@app = proc do |env|
|
13
12
|
env['sinatra.error'] = exception
|
14
|
-
[
|
13
|
+
[ 404, {}, [] ]
|
15
14
|
end
|
16
15
|
@exception = exception
|
17
16
|
@show_exceptions = Deas::ShowExceptions.new(@app)
|
@@ -23,7 +22,7 @@ class Deas::ShowExceptions
|
|
23
22
|
should "return a body that contains details about the exception" do
|
24
23
|
status, headers, body = subject.call({})
|
25
24
|
expected_body = "#{@exception.class}: #{@exception.message}\n" \
|
26
|
-
"#{@exception.backtrace.join("\n")}"
|
25
|
+
"#{(@exception.backtrace || []).join("\n")}"
|
27
26
|
expected_body_size = Rack::Utils.bytesize(expected_body).to_s
|
28
27
|
|
29
28
|
assert_equal expected_body_size, headers['Content-Length']
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 14
|
9
|
-
-
|
10
|
-
version: 0.14.
|
9
|
+
- 1
|
10
|
+
version: 0.14.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-05-
|
19
|
+
date: 2013-05-24 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: ns-options
|