Sha256: df8a433cfb66c598e987526c439785e11b2bfbdd1b7b7bdb5ea0049f8d4e3ae8

Contents?: true

Size: 743 Bytes

Versions: 10

Compression:

Stored size: 743 Bytes

Contents

require 'test_helper'

# This tests our Ourdate class
class OurdateTest < Minitest::Test
  def test_date_and_time
    d = Ourdate.build_datetime(2003, 11, 30)
    assert_equal '2003-11-30', d.to_iso
    assert_equal '30.11.2003', d.to_formatted_s
    assert_equal '30.11.2003', d.to_s
  end

  def test_ourdate
    # Creating an Ourdate from a String
    od = Ourdate.new('01.02.2000')
    assert_equal Date.new(2000, 2, 1).to_formatted_s(:ui), od.to_s
    assert_kind_of Date, od.thedate
    assert_equal '01.02.2000', od.thedate.to_s
    # Creating an Ourdate from a Date
    od = Ourdate.new(Date.new(2000, 3, 1))
    assert_equal '01.03.2000', od.to_s
  end

  def test_blank
    assert Ourdate.new.blank?  # delegates to empty?
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ndr_support-5.10.4 test/ourdate_test.rb
ndr_support-5.10.3 test/ourdate_test.rb
ndr_support-5.10.2 test/ourdate_test.rb
ndr_support-5.10.1 test/ourdate_test.rb
ndr_support-5.10.0 test/ourdate_test.rb
ndr_support-5.9.7 test/ourdate_test.rb
ndr_support-5.9.6 test/ourdate_test.rb
ndr_support-5.9.5 test/ourdate_test.rb
ndr_support-5.9.4 test/ourdate_test.rb
ndr_support-5.9.3 test/ourdate_test.rb