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
tdiary-5.0.4 vendor/bundle/gems/tins-1.13.2/tests/date_time_dummy_test.rb
tins-1.13.2 tests/date_time_dummy_test.rb
ivanvc-logstash-input-s3-3.1.1.4 vendor/local/gems/tins-1.13.0/tests/date_time_dummy_test.rb
ivanvc-logstash-input-s3-3.1.1.3 vendor/local/gems/tins-1.13.0/tests/date_time_dummy_test.rb
ivanvc-logstash-input-s3-3.1.1.2 vendor/local/gems/tins-1.13.0/tests/date_time_dummy_test.rb
tins-1.13.0 tests/date_time_dummy_test.rb
tdiary-5.0.2 vendor/bundle/gems/tins-1.12.0/tests/date_time_dummy_test.rb
tins-1.12.0 tests/date_time_dummy_test.rb
tins-1.11.0 tests/date_time_dummy_test.rb
tdiary-5.0.1 vendor/bundle/gems/tins-1.10.2/tests/date_time_dummy_test.rb
tins-1.10.2 tests/date_time_dummy_test.rb
tins-1.10.1 tests/date_time_dummy_test.rb
tins-1.10.0 tests/date_time_dummy_test.rb
tins-1.9.0 tests/date_time_dummy_test.rb
tins-1.8.2 tests/date_time_dummy_test.rb
tins-1.8.1 tests/date_time_dummy_test.rb
tins-1.8.0 tests/date_time_dummy_test.rb
tins-1.7.0 tests/date_time_dummy_test.rb
suzuko-0.1.8 vendor/bundle/ruby/2.0.0/gems/tins-1.6.0/tests/date_time_dummy_test.rb
suzuko-0.1.7 vendor/bundle/ruby/2.0.0/gems/tins-1.6.0/tests/date_time_dummy_test.rb