Sha256: 2d79d433c77f0ccfb3d7b75b3a9f58348ad95bc1548b05a7596e47ad2b55cf57

Contents?: true

Size: 640 Bytes

Versions: 9

Compression:

Stored size: 640 Bytes

Contents

require 'spec_helper'

describe Timespan::Span do
  subject { timespan }

  let(:from) { Chronic.parse("1 day ago") }
  let(:to)   { Time.now }

  describe '.asap factory method' do
    let(:timespan) { Timespan.asap :to => to }    

    its(:asap?) { should be_true }
  end

  describe '.asap=' do
    before do
      @timespan = Timespan.new :from => from, :to => to
      @timespan.asap = true
    end

    specify { @timespan.asap?.should be_true }
  end

  describe '.asap!' do
    before do
      @timespan = Timespan.new :from => from, :to => to
      @timespan.asap!
    end

    specify { @timespan.asap?.should be_true }
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
timespan-0.6.0 spec/timespan/asap_spec.rb
timespan-0.5.9 spec/timespan/asap_spec.rb
timespan-0.5.7 spec/timespan/asap_spec.rb
timespan-0.5.6.1 spec/timespan/asap_spec.rb
timespan-0.5.6 spec/timespan/asap_spec.rb
timespan-0.5.5 spec/timespan/asap_spec.rb
timespan-0.5.4 spec/timespan/asap_spec.rb
timespan-0.5.3 spec/timespan/asap_spec.rb
timespan-0.5.2 spec/timespan/asap_spec.rb