Sha256: a54c169e59df9c5d28e0a67d9391aad70cc348026020eb32026fff47beb24ff6

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

require 'spec_helper'

describe Timeparser do
  it "creates instance" do
    Timeparser::Parser.new.should_not be_nil
  end

  let(:parser){ Timeparser::Parser.new }

  it "parses hours" do
    parser.parse('1h').should eql 60
  end

  it "parses minutes" do
    parser.parse('1m').should eql 1
  end

  it "parses hours and minutes" do
    parser.parse('1h20m').should eql 80
  end

  it "parses dot notation" do
    parser.parse('1:20').should eql 80
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
timeparser-0.0.1 spec/lib/timeparser_spec.rb