Sha256: 1c0942292e031420d606abc7ce343840fe49b9c42aaaba360697cec9a9ad68ba

Contents?: true

Size: 723 Bytes

Versions: 4

Compression:

Stored size: 723 Bytes

Contents

require 'test_helper'

module Playa
  class HelpersTest
    include Helpers
  end

  describe Helpers do
    let(:receiver) { HelpersTest.new }
    let(:track)    { mock('Track') }

    before { track.stubs(:duration).returns(4321.6543) }

    describe '#duration' do
      it 'returns a human readable version of the track duration' do
        receiver.duration(track).must_equal('12:02')
      end
    end

    describe '#remaining' do
      let(:player) { mock('Player') }

      before { player.stubs(:counter).returns(42) }

      it 'returns a human readable version of the remaining time for a ' \
         'playing track' do
        receiver.remaining(track, player).must_equal('11:19')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
playa-0.1.0 test/lib/playa/helpers/helpers_test.rb
playa-0.0.15 test/lib/playa/helpers/helpers_test.rb
playa-0.0.14 test/lib/playa/helpers/helpers_test.rb
playa-0.0.13 test/lib/playa/helpers/helpers_test.rb