Sha256: fd9b1d6bce3e180b583e05aab9a41d3f867f9ef0ae10f7fa0637a9fc716243f9

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

require 'spec_helper'

describe TimerCli do
  describe TimerCli::Parameters do
    def params(argv)
      TimerCli::Parameters.new([argv])
    end

    context 'receive a valid parameter' do
      let(:sec)   { params('10s').sec }
      let(:sec_2) { params('10m').sec }

      it 'should return correct second' do
        expect(sec).to   eq 10
        expect(sec_2).to eq 600
      end
    end

    context 'receive a invalid parameter' do
      let(:sec) { params('10h').sec }

      it 'should raise error' do
        expect { sec } .to raise_error(ArgumentError)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
timer_cli-0.0.1 spec/timer_cli_spec.rb