Sha256: 08d0513cbd138a1b5e7e256526f886dc5d5c488c25b36d9e3384fcf12698a916

Contents?: true

Size: 733 Bytes

Versions: 4

Compression:

Stored size: 733 Bytes

Contents

require 'test_helper'

module Tins
  class TimeDummyTest < Test::Unit::TestCase
    require 'tins/xt/time_dummy'
    require 'time'

    def test_time_dummy
      time = Time.parse('2009-09-09 21:09:09')
      assert_not_equal time, Time.now
      Time.dummy = time
      assert_equal time, Time.now
      Time.dummy = nil
      assert_not_equal time, Time.now
    end

    def test_time_dummy_block
      time = Time.parse('2009-09-09 21:09:09')
      assert_not_equal time, Time.now
      Time.dummy time do
        assert_equal time, Time.now
        Time.dummy time + 1 do
          assert_equal time + 1, Time.now
        end
        assert_equal time, Time.now
      end
      assert_not_equal time, Time.now
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tins-1.37.0 tests/time_dummy_test.rb
tins-1.36.1 tests/time_dummy_test.rb
tins-1.36.0 tests/time_dummy_test.rb
tins-1.35.0 tests/time_dummy_test.rb