Sha256: eb6dfd278e40be2436391e3ea6df1b63d4a1ad87e8ff071124e1214ae7b2ade2

Contents?: true

Size: 538 Bytes

Versions: 6

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'
require 'image_optim/timer'

describe ImageOptim::Timer do
  let!(:timer){ described_class.new(1) }

  describe '#elapsed' do
    it 'returns elapsed time' do
      sleep 0.01

      expect(timer.elapsed).to be >= 0.01
    end
  end

  describe '#left' do
    it 'returns time left' do
      sleep 0.01

      expect(timer.left).to be <= 0.99
    end
  end

  describe '#to_f' do
    it 'returns time left' do
      sleep 0.01

      expect(timer.to_f).to be <= 0.99
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
image_optim-0.31.4 spec/image_optim/timer_spec.rb
image_optim-0.31.3 spec/image_optim/timer_spec.rb
image_optim-0.31.2 spec/image_optim/timer_spec.rb
image_optim-0.31.1 spec/image_optim/timer_spec.rb
image_optim-0.31.0 spec/image_optim/timer_spec.rb
image_optim-0.30.0 spec/image_optim/timer_spec.rb