lib/fitting/cover.rb in fitting-2.7.1 vs lib/fitting/cover.rb in fitting-2.7.2
- old
+ new
@@ -32,19 +32,19 @@
@template[key] = value
@template[key]['cover'] = 100.0
if value['flags'] == []
@template[key]['type'] = 'passed'
else
- flag_true = value['flags'].find_all{|flag| flag == true}
- flag_false = value['flags'].find_all{|flag| flag == false}
- if flag_false.size == 0
+ flag_true = value['flags'].find_all { |flag| flag == true }
+ flag_false = value['flags'].find_all { |flag| flag == false }
+ if flag_false.empty?
@template[key]['type'] = 'passed'
else
- if flag_true.size == 0
- @template[key]['cover'] = 0.0
- else
- @template[key]['cover'] = flag_false.size / flag_true.size
- end
+ @template[key]['cover'] = if flag_true.empty?
+ 0.0
+ else
+ flag_false.size / flag_true.size
+ end
@template[key]['type'] = 'failed'
end
end
@template[key]['json_schema'] = JSON.pretty_generate(value['json_schemas'].last)
end