travis-ci
9 of 9 new or added lines in 5 files covered. (100.0%)
10484 of 10740 relevant lines covered (97.62%)
1287.59 hits per line
1 |
# encoding: utf-8
|
|
2 |
|
|
3 |
require 'faraday'
|
4✔ |
4 |
require 'json'
|
4✔ |
5 |
|
|
6 |
module Github |
4✔ |
7 |
class Response::Jsonize < Response |
4✔ |
8 |
|
|
9 |
dependency 'json'
|
4✔ |
10 |
|
|
11 |
define_parser do |body|
|
4✔ |
12 |
JSON.parse(body)
|
2,932✔ |
13 |
end
|
|
14 |
|
|
15 |
def parse(body) |
4✔ |
16 |
case body
|
2,976✔ |
17 |
when '' |
|
18 |
nil
|
|
19 |
when 'true' |
|
20 |
true
|
× |
21 |
when 'false' |
|
22 |
false
|
× |
23 |
else
|
|
24 |
self.class.parser.call(body)
|
2,932✔ |
25 |
end
|
|
26 |
end
|
|
27 |
end # Response::Jsonize |
|
28 |
end # Github |