Sha256: ac1f321c57ec94c18131d1df57a9ea15e5593814375fe61f58211a7a5d7f1a9a

Contents?: true

Size: 533 Bytes

Versions: 3

Compression:

Stored size: 533 Bytes

Contents

require 'spec_helper'

describe Spanx::Helper::Timing do
  class TestClass
    include Spanx::Helper::Timing
  end

  let(:tester) { TestClass.new }

  describe "#period_marker" do
    let(:time) { DateTime.parse('2001-02-02T21:03:26+00:00').to_time }

    before { time.to_i.should == 981147806 }

    it "returns unix time floored to the nearest resolution block" do
      Timecop.freeze time do
        tester.period_marker(10).should == 981147800
        tester.period_marker(300).should == 981147600
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spanx-0.3.0 spec/spanx/helper/timing_spec.rb
spanx-0.1.1 spec/spanx/helper/timing_spec.rb
spanx-0.1.0 spec/spanx/helper/timing_spec.rb