Sha256: 7bdb844bb699bbe2837cbeecb8295b170ce55169e342a6655e7a860935123056

Contents?: true

Size: 878 Bytes

Versions: 157

Compression:

Stored size: 878 Bytes

Contents

require 'test_helper'
require 'tins'

module Tins
  class DateTimeDummyTest < Test::Unit::TestCase
    require 'tins/xt/date_time_dummy'
    require 'date'

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

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

Version data entries

157 entries across 139 versions & 9 rubygems

Version Path
tins-0.7.2 tests/date_time_dummy_test.rb
tins-0.7.1 tests/date_time_dummy_test.rb
tins-0.7.0 tests/date_time_dummy_test.rb
tins-0.6.0 tests/date_time_dummy_test.rb
tins-0.5.6 tests/date_time_dummy_test.rb
tins-0.5.5 tests/date_time_dummy_test.rb
tins-0.5.4 tests/date_time_dummy_test.rb
tins-0.5.3 tests/date_time_dummy_test.rb
tins-0.5.2 tests/date_time_dummy_test.rb
tins-0.5.1 tests/date_time_dummy_test.rb
tins-0.5.0 tests/date_time_dummy_test.rb
tins-0.4.3 tests/date_time_dummy_test.rb
tins-0.4.2 tests/date_time_dummy_test.rb
tins-0.4.1 tests/date_time_dummy_test.rb
tins-0.4.0 tests/date_time_dummy_test.rb
tins-0.3.14 tests/date_time_dummy_test.rb
tins-0.3.13 tests/date_time_dummy_test.rb