push
travis-ci
123 of 147 relevant lines covered (83.67%)
14.41 hits per line
1 |
module Hanami |
15 only ruby-head and 2.3.3 ✔ |
2 |
# @api private
|
|
3 |
module Routing |
15 only ruby-head and 2.3.3 ✔ |
4 |
# The default Rack application that responds when a resource cannot be found.
|
|
5 |
#
|
|
6 |
# @since 0.1.0
|
|
7 |
# @api private
|
|
8 |
class Default |
15 only ruby-head and 2.3.3 ✔ |
9 |
# @api private
|
|
10 |
DEFAULT_CODE = 404 |
15 only ruby-head and 2.3.3 ✔ |
11 |
# @api private
|
|
12 |
DEFAULT_BODY = ['Not Found'].freeze |
15 only ruby-head and 2.3.3 ✔ |
13 |
# @api private
|
|
14 |
CONTENT_TYPE = 'Content-Type'.freeze |
15 only ruby-head and 2.3.3 ✔ |
15 |
|
|
16 |
# @api private
|
|
17 |
class NullAction |
15 only ruby-head and 2.3.3 ✔ |
18 |
include Hanami::Action |
15 only ruby-head and 2.3.3 ✔ |
19 |
|
|
20 |
# @api private
|
|
21 |
def call(env) |
15 only ruby-head and 2.3.3 ✔ |
22 |
end
|
|
23 |
end
|
|
24 |
|
|
25 |
# @api private
|
|
26 |
def call(env) |
15 only ruby-head and 2.3.3 ✔ |
27 |
action = NullAction.new.tap { |a| a.call(env) }
|
× |
28 |
[ DEFAULT_CODE, {CONTENT_TYPE => action.content_type}, DEFAULT_BODY, action ] |
× |
29 |
end
|
|
30 |
end
|
|
31 |
end
|
|
32 |
end
|