Sha256: 32a27b069ae345690f154dd5924058574c9ba09cacd6c2bdf1a671943397be01

Contents?: true

Size: 411 Bytes

Versions: 9

Compression:

Stored size: 411 Bytes

Contents

require "spec_helper"

describe Tabs::Metrics::Task::Token do

  describe "#time_elapsed" do

    let(:token) { Tabs::Metrics::Task::Token.new("foo", "bar") }
    let(:time) { Time.now }

    it "should return the time between when the task/token started and completed" do
      token.start(time - 2.days)
      token.complete(time - 1.day)
      expect(token.time_elapsed(:hour)).to eq(24)
    end

  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
tabs-1.0.1 spec/lib/tabs/metrics/task/token_spec.rb
tabs-1.0.0 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.9.1 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.9.0 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.8.2 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.8.1 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.8.0 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.7.1 spec/lib/tabs/metrics/task/token_spec.rb
tabs-0.7.0 spec/lib/tabs/metrics/task/token_spec.rb