class Rsummary::Save

Public Instance Methods

dump_summary(notification) click to toggle source
# File lib/rsummary/save.rb, line 11
def dump_summary(notification)
  summary = summary(notification)

  data = if file_exists?
           merge(summary, load_json)
         else
           merge(summary)
         end.to_json

  save_to_file(data)
end
merge(result, json = {}) click to toggle source
# File lib/rsummary/save.rb, line 37
def merge(result, json = {})
  json[Time.now.to_i.to_s] = result
  json
end
seed(notification) click to toggle source
# File lib/rsummary/save.rb, line 23
def seed(notification)
end
summary(notification) click to toggle source
# File lib/rsummary/save.rb, line 26
def summary(notification)
  { example_count: notification.example_count,
    pending_count: notification.pending_count,
    failure_count: notification.failure_count,
    duration: notification.duration,
    totals_line: notification.totals_line,
    formatted_duration: notification.formatted_duration,
    fully_formatted: notification.fully_formatted
  }
end