Sha256: 391e6137188bc2e700957cfbb7fd8acfab7e571b8924082ec92ebbd8c24a9f8e

Contents?: true

Size: 590 Bytes

Versions: 8

Compression:

Stored size: 590 Bytes

Contents

require_relative 'support/spec_helper'

require 'time_distribution/smart_duration'

include TimeDistribution
describe SmartDuration do
  describe '::parse' do
    describe 'can interpret a range of times' do
      it 'written with "to"' do
        SmartDuration.parse('10am to 11:30am').total.must_equal 1.5.hours
      end
      it 'written with "-"' do
        SmartDuration.parse('10am-11:11am').total.must_equal 1.hours + 11.minutes
      end
    end
    it 'can interpret an explicit range' do
      SmartDuration.parse('1 hour 30 minutes').total.must_equal 1.5.hours
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
time_distribution-2.1.2 spec/smart_duration_spec.rb
time_distribution-2.1.1 spec/smart_duration_spec.rb
time_distribution-2.1.0 spec/smart_duration_spec.rb
time_distribution-2.0.2 spec/smart_duration_spec.rb
time_distribution-2.0.1 spec/smart_duration_spec.rb
time_distribution-2.0.0 spec/smart_duration_spec.rb
time_distribution-1.1.0 spec/smart_duration_spec.rb
time_distribution-1.0.0 spec/smart_duration_spec.rb