lib/fitting/statistics/list.rb in fitting-2.6.0 vs lib/fitting/statistics/list.rb in fitting-2.7.0
- old
+ new
@@ -1,11 +1,12 @@
module Fitting
class Statistics
class List
- def initialize(coverage, max_response_path)
+ def initialize(coverage, max_response_path, depth)
@coverage = coverage
@max_response_path = max_response_path
+ @depth = depth
end
def to_s
list_sort.inject([]) do |res, request|
res.push("#{request.method}\t#{request.path}#{responses_stat(request)}")
@@ -32,13 +33,17 @@
json_schema_stat(res, json_schema, response)
end
end
def json_schema_stat(res, json_schema, response)
- if json_schema.bodies == []
- res.push("✖ #{response.status}")
+ if @depth == 'valid'
+ if json_schema.bodies == []
+ res.push("✖ #{response.status}")
+ else
+ res.push("✔ #{response.status}")
+ end
else
- res.push("✔ #{response.status}")
+ res.push("#{json_schema.cover}% #{response.status}")
end
end
end
end
end