Sha256: 69fbfcdbf526ca736cddc8c73f82b4900062786d05c2c29476f14141b05a683a

Contents?: true

Size: 504 Bytes

Versions: 2

Compression:

Stored size: 504 Bytes

Contents

require 'spec_helper'

describe Mercy::PeriodParser do
  subject { described_class }

  it_behaves_like 'a method that knows how to parse time', :parse, {
    '3' => 3.seconds,
    '3seconds' => 3.seconds,
    '3minutes' => 3.minutes,
    '3hours' => 3.hours,
    '3days' => 3.days,
    '3months' => 3.months,
    '3years' => 3.years
  }

  context 'when value is already a period' do
    it 'returns the value itself' do
      expect(described_class.parse(3.minutes)).to eq(3.minutes)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mercy-1.6.0 spec/lib/mercy/period_parser_spec.rb
mercy-1.5.0 spec/lib/mercy/period_parser_spec.rb