Sha256: 98ca5508a2f7b2ef536e4956a8880f9e5650987dafcffcd6fe698b38eea3b59a

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true

require "./test/helper"

clean_describe "stats" do
  subject { run_cmd("stats") }

  describe "when file does not exist" do
    it "returns the stats" do
      stdout_only <<-FILE
Total activities: 0
Total friends: 0
Total time elapsed: 0 days
      FILE
    end
  end

  describe "when the file is empty" do
    let(:content) { "" }

    it "returns the stats" do
      stdout_only <<-FILE
Total activities: 0
Total friends: 0
Total time elapsed: 0 days
      FILE
    end
  end

  describe "when file has stats" do
    let(:content) { CONTENT }

    it "returns the content" do
      stdout_only <<-FILE
Total activities: 4
Total friends: 3
Total time elapsed: 351 days
      FILE
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
friends-0.30 test/commands/stats_spec.rb
friends-0.29 test/commands/stats_spec.rb