Tests for DK, ZA and AU
This commit is contained in:
parent
b6968ccdb3
commit
b50747d3e0
7 changed files with 97 additions and 15 deletions
|
@ -32,14 +32,11 @@ months:
|
|||
function: easter(year)+26
|
||||
- name: Kristi Himmelfartsdag
|
||||
regions: [dk]
|
||||
function: easter(year)+40
|
||||
- name: Kristi Himmelfartsdag
|
||||
regions: [dk]
|
||||
function: easter(year)+40
|
||||
- name: 2. Pinsedag
|
||||
function: easter(year)+39
|
||||
- name: Pinsedag
|
||||
regions: [dk]
|
||||
function: easter(year)+49
|
||||
- name: Pinsedag
|
||||
- name: 2. Pinsedag
|
||||
regions: [dk]
|
||||
function: easter(year)+50
|
||||
1:
|
||||
|
|
|
@ -23,9 +23,9 @@ module Holidays
|
|||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. påskedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+26 }, :function_id => "easter(year)+26", :name => "Store Bededag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+40 }, :function_id => "easter(year)+40", :name => "Kristi Himmelfartsdag", :regions => [:dk, :dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "2. Pinsedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinsedag", :regions => [:dk]}],
|
||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]}],
|
||||
11 => [{:mday => 10, :type => :informal, :name => "Mortensaften", :regions => [:dk]}],
|
||||
6 => [{:mday => 5, :name => "Grundlovsdag", :regions => [:dk]},
|
||||
{:mday => 15, :type => :informal, :name => "Valdemarsdag og Genforeningsdag", :regions => [:dk]},
|
||||
|
|
|
@ -40,9 +40,9 @@ module Holidays
|
|||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. påskedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+26 }, :function_id => "easter(year)+26", :name => "Store Bededag", :regions => [:dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+40 }, :function_id => "easter(year)+40", :name => "Kristi Himmelfartsdag", :regions => [:dk, :dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "2. Pinsedag", :regions => [:dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinsedag", :regions => [:dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Karfreitag", :regions => [:de]},
|
||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :type => :informal, :name => "Ostern", :regions => [:de]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Ostermontag", :regions => [:de]},
|
||||
|
@ -68,6 +68,9 @@ module Holidays
|
|||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Föstudaginn langi", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páskadagur", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annar í páskum", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+40 }, :function_id => "easter(year)+40", :name => "Kristi Himmelfartsdag", :regions => [:is, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "2. Pinsedag", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinsedag", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Pasqua", :regions => [:it]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Lunedì dell'Angelo", :regions => [:it]},
|
||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Goede Vrijdag", :regions => [:nl]},
|
||||
|
|
|
@ -26,9 +26,9 @@ module Holidays
|
|||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "2. påskedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+26 }, :function_id => "easter(year)+26", :name => "Store Bededag", :regions => [:dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+40 }, :function_id => "easter(year)+40", :name => "Kristi Himmelfartsdag", :regions => [:dk, :dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "2. Pinsedag", :regions => [:dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinsedag", :regions => [:dk, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+39 }, :function_id => "easter(year)+39", :name => "Kristi Himmelfartsdag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "Pinsedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "2. Pinsedag", :regions => [:dk]},
|
||||
{:function => lambda { |year| Holidays.easter(year)-48 }, :function_id => "easter(year)-48", :name => "Bolludagur", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)-47 }, :function_id => "easter(year)-47", :name => "Sprengidagur", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)-46 }, :function_id => "easter(year)-46", :name => "Öskudagur", :regions => [:is]},
|
||||
|
@ -37,6 +37,9 @@ module Holidays
|
|||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Föstudaginn langi", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Páskadagur", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annar í páskum", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+40 }, :function_id => "easter(year)+40", :name => "Kristi Himmelfartsdag", :regions => [:is, :is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+49 }, :function_id => "easter(year)+49", :name => "2. Pinsedag", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+50 }, :function_id => "easter(year)+50", :name => "Pinsedag", :regions => [:is]},
|
||||
{:function => lambda { |year| Holidays.easter(year)-2 }, :function_id => "easter(year)-2", :name => "Långfredagen", :regions => [:se]},
|
||||
{:function => lambda { |year| Holidays.easter(year) }, :function_id => "easter(year)", :name => "Påskdagen", :regions => [:se]},
|
||||
{:function => lambda { |year| Holidays.easter(year)+1 }, :function_id => "easter(year)+1", :name => "Annandag påsk", :regions => [:se]},
|
||||
|
|
32
test/test_region_au.rb
Normal file
32
test/test_region_au.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
require File.dirname(__FILE__) + '/test_helper'
|
||||
require 'holidays/au'
|
||||
|
||||
class AUTests < Test::Unit::TestCase
|
||||
def test_au
|
||||
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
||||
Date.civil(2007,1,26) => 'Australia Day',
|
||||
Date.civil(2007,4,6) => 'Good Friday',
|
||||
Date.civil(2007,4,9) => 'Easter Monday',
|
||||
Date.civil(2007,4,25) => 'ANZAC Day',
|
||||
Date.civil(2007,12,25) => 'Christmas Day',
|
||||
Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name|
|
||||
assert_equal name, Holidays.on(date, :au, :informal)[0][:name]
|
||||
end
|
||||
|
||||
[:au_sa, :au_act, :au_nsw, :au_].each do |r|
|
||||
assert_equal 'Labour Day', Date.civil(2007,10,1).holidays(r)[0][:name]
|
||||
end
|
||||
|
||||
[:au_sa, :au_act, :au_nsw, :au_vic, :au_tas, :au_qld, :au_nt, :au_].each do |r|
|
||||
assert_equal 'Queen\'s Birthday', Date.civil(2007,6,11).holidays(r)[0][:name]
|
||||
end
|
||||
|
||||
assert_equal 'Labour Day', Date.civil(2007,3,5).holidays(:au_wa)[0][:name]
|
||||
assert_equal 'Labour Day', Date.civil(2007,3,12).holidays(:au_vic)[0][:name]
|
||||
assert_equal 'Labour Day', Date.civil(2007,5,7).holidays(:au_qld)[0][:name]
|
||||
|
||||
assert_equal 'May Day', Date.civil(2007,5,7).holidays(:au_nt)[0][:name]
|
||||
|
||||
assert_equal 'Eight Hours Day', Date.civil(2007,3,12).holidays(:au_tas)[0][:name]
|
||||
end
|
||||
end
|
26
test/test_region_dk.rb
Normal file
26
test/test_region_dk.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
require File.dirname(__FILE__) + '/test_helper'
|
||||
require 'holidays/dk'
|
||||
|
||||
class DKTests < Test::Unit::TestCase
|
||||
def test_dk
|
||||
{Date.civil(2007,1,1) => 'Nytårsdag',
|
||||
Date.civil(2007,2,18) => 'Fastelavn',
|
||||
Date.civil(2007,4,9) => 'Danmarks besættelse',
|
||||
Date.civil(2007,4,16) => 'Dronningens fødselsdag',
|
||||
Date.civil(2007,4,5) => 'Skærtorsdag',
|
||||
Date.civil(2007,4,6) => 'Langfredag',
|
||||
Date.civil(2007,4,8) => 'Påskedag',
|
||||
Date.civil(2007,4,9) => '2. påskedag',
|
||||
Date.civil(2007,5,1) => 'Arbejdernes kampdag',
|
||||
Date.civil(2007,5,4) => 'Store Bededag',
|
||||
Date.civil(2007,5,17) => 'Kristi Himmelfartsdag',
|
||||
Date.civil(2007,5,27) => 'Pinsedag',
|
||||
Date.civil(2007,5,28) => '2. Pinsedag',
|
||||
Date.civil(2007,6,5) => 'Grundlovsdag',
|
||||
Date.civil(2007,12,24) => 'Juleaftensdag',
|
||||
Date.civil(2007,12,25) => '1. juledag',
|
||||
Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
|
||||
assert_equal name, Holidays.on(date, :dk, :informal)[0][:name]
|
||||
end
|
||||
end
|
||||
end
|
21
test/test_region_za.rb
Normal file
21
test/test_region_za.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
require File.dirname(__FILE__) + '/test_helper'
|
||||
require 'holidays/za'
|
||||
|
||||
class ZATests < Test::Unit::TestCase
|
||||
def test_za
|
||||
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
||||
Date.civil(2007,3,21) => 'Human Rights Day',
|
||||
Date.civil(2007,4,6) => 'Good Friday',
|
||||
Date.civil(2007,4,9) => 'Family Day',
|
||||
Date.civil(2007,4,27) => 'Freedom Day',
|
||||
Date.civil(2007,5,1) => 'Workers Day',
|
||||
Date.civil(2007,6,16) => 'Youth Day',
|
||||
Date.civil(2007,8,9) => 'National Women\'s Day',
|
||||
Date.civil(2007,9,24) => 'Heritage Day',
|
||||
Date.civil(2007,12,16) => 'Day of Reconciliation',
|
||||
Date.civil(2007,12,25) => 'Christmas Day',
|
||||
Date.civil(2007,12,26) => 'Day of Goodwill'}.each do |date, name|
|
||||
assert_equal name, Holidays.on(date, :za, :informal)[0][:name]
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue