Sha256: a902cde9ecdf09322e9009ea70963b2b3253c7ac8e967ec81aea30b1389c958b

Contents?: true

Size: 492 Bytes

Versions: 7

Compression:

Stored size: 492 Bytes

Contents

require 'spec_helper'

module Prosperity
  describe Periods do
    subject { Periods::DAY }

    describe "#each_period" do
      it "iterates until the end time" do
        times = []
        start_time = DateTime.new(2012, 01, 01)
        end_time = DateTime.new(2012, 01, 05)

        subject.each_period(start_time, end_time) do |start_time|
          times << start_time
        end

        times.should == Array.new(7) { |i| DateTime.new(2012, 01, i + 1) }
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
prosperity-0.0.9 spec/lib/prosperity/periods_spec.rb
prosperity-0.0.8 spec/lib/prosperity/periods_spec.rb
prosperity-0.0.7 spec/lib/prosperity/periods_spec.rb
prosperity-0.0.6 spec/lib/prosperity/periods_spec.rb
prosperity-0.0.5 spec/lib/prosperity/periods_spec.rb
prosperity-0.0.4 spec/lib/prosperity/periods_spec.rb
prosperity-0.0.3 spec/lib/prosperity/periods_spec.rb