Sha256: 7ace2d1fce9066a6f2bcf8f88ac21213dfea546e2fd6dd6b4ad5d0e7778f2dd9
Contents?: true
Size: 1.44 KB
Versions: 6
Compression:
Stored size: 1.44 KB
Contents
require "test_helper" class CoreExtDateTest < ActiveSupport::TestCase test "should correctly identify the nth weekday of the month of a date" do assert_equal 1, Date.new(2012, 7, 1).get_nth_wday_of_month assert_equal 1, Date.new(2012, 7, 7).get_nth_wday_of_month assert_equal 2, Date.new(2012, 7, 8).get_nth_wday_of_month assert_equal 2, Date.new(2012, 7, 14).get_nth_wday_of_month assert_equal 3, Date.new(2012, 7, 15).get_nth_wday_of_month assert_equal 3, Date.new(2012, 7, 21).get_nth_wday_of_month assert_equal 4, Date.new(2012, 7, 22).get_nth_wday_of_month assert_equal 4, Date.new(2012, 7, 28).get_nth_wday_of_month assert_equal 5, Date.new(2012, 7, 29).get_nth_wday_of_month end test "should correctly identify the nth weekday of the month of a date as a string" do assert_equal "1 Sunday", Date.new(2012, 7, 1).get_nth_wday_string assert_equal "1 Saturday", Date.new(2012, 7, 7).get_nth_wday_string assert_equal "2 Sunday", Date.new(2012, 7, 8).get_nth_wday_string assert_equal "2 Saturday", Date.new(2012, 7, 14).get_nth_wday_string assert_equal "3 Sunday", Date.new(2012, 7, 15).get_nth_wday_string assert_equal "3 Saturday", Date.new(2012, 7, 21).get_nth_wday_string assert_equal "4 Sunday", Date.new(2012, 7, 22).get_nth_wday_string assert_equal "4 Saturday", Date.new(2012, 7, 28).get_nth_wday_string assert_equal "5 Sunday", Date.new(2012, 7, 29).get_nth_wday_string end end
Version data entries
6 entries across 6 versions & 1 rubygems