Sha256: 08ebef80619a761e65205fd358457ed3f4f94f20b8447262d3e79808e8b68fa2

Contents?: true

Size: 610 Bytes

Versions: 5

Compression:

Stored size: 610 Bytes

Contents

require File.dirname(__FILE__) + '/../abstract_unit'

class DateExtCalculationsTest < Test::Unit::TestCase
  def test_to_s
    assert_equal "21 Feb",            Date.new(2005, 2, 21).to_s(:short)
    assert_equal "February 21, 2005", Date.new(2005, 2, 21).to_s(:long)
  end

  def test_to_time
    assert_equal Time.local(2005, 2, 21), Date.new(2005, 2, 21).to_time
  end

  def test_to_time_on_datetime
    assert_equal Time.local(2005, 2, 21, 10, 11, 12), DateTime.new(2005, 2, 21, 10, 11, 12).to_time
  end

  def test_to_date
    assert_equal Date.new(2005, 2, 21), Date.new(2005, 2, 21).to_date
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
radiant-0.6.0 vendor/rails/activesupport/test/core_ext/date_ext_test.rb
radiant-0.6.1 vendor/rails/activesupport/test/core_ext/date_ext_test.rb
radiant-0.6.3 vendor/rails/activesupport/test/core_ext/date_ext_test.rb
radiant-0.6.2 vendor/rails/activesupport/test/core_ext/date_ext_test.rb
radiant-0.6.4 vendor/rails/activesupport/test/core_ext/date_ext_test.rb