Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
issue-7: modify all tests to be in pure YAML rather than raw ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Trimble authored and Phil Peble committed Apr 25, 2017
1 parent d93419c commit 0656cf4
Show file tree
Hide file tree
Showing 61 changed files with 9,390 additions and 1,658 deletions.
123 changes: 103 additions & 20 deletions ar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,106 @@ months:
- name: Navidad
regions: [ar]
mday: 25
tests: |
{Date.civil(2016,1,1) => 'Año Nuevo',
Date.civil(2016,2,8) => 'Carnaval',
Date.civil(2016,2,9) => 'Carnaval',
Date.civil(2016,3,24) => 'Día Nacional de la Memoria por la Verdad y la Justicia',
Date.civil(2016,3,25) => 'Viernes Santo',
Date.civil(2016,4,2) => 'Día del Veterano y de los Caídos en la Guerra de Malvinas',
Date.civil(2016,5,1) => 'Día del Trabajador',
Date.civil(2016,5,25) => 'Día de la Revolución de Mayo',
Date.civil(2016,6,20) => 'Día de la Bandera',
Date.civil(2016,7,8) => 'Feriado puente turístico',
Date.civil(2016,7,9) => 'Día de la Independencia',
Date.civil(2016,8,15) => 'Paso a la Inmortalidad del General José de San Martín',
Date.civil(2016,10,12) => 'Día del Respeto a la Diversidad Cultural',
Date.civil(2016,11,20) => 'Día de la Soberanía Nacional',
Date.civil(2016,12,8) => 'Inmaculada Concepción de María',
Date.civil(2016,12,9) => 'Feriado puente turístico',
Date.civil(2016,12,25) => 'Navidad'}.each do |date, name|
assert_equal name, (Holidays.on(date, :ar, :informal)[0] || {})[:name]
end
tests:
- given:
date: '2016-01-01'
regions: ['ar']
options: 'informal'
expect:
name: 'Año Nuevo'
- given:
date: '2016-02-08'
regions: ['ar']
options: 'informal'
expect:
name: 'Carnaval'
- given:
date: '2016-02-09'
regions: ['ar']
options: 'informal'
expect:
name: 'Carnaval'
- given:
date: '2016-03-24'
regions: ['ar']
options: 'informal'
expect:
name: 'Día Nacional de la Memoria por la Verdad y la Justicia'
- given:
date: '2016-03-25'
regions: ['ar']
options: 'informal'
expect:
name: 'Viernes Santo'
- given:
date: '2016-04-02'
regions: ['ar']
options: 'informal'
expect:
name: 'Día del Veterano y de los Caídos en la Guerra de Malvinas'
- given:
date: '2016-05-01'
regions: ['ar']
options: 'informal'
expect:
name: 'Día del Trabajador'
- given:
date: '2016-05-25'
regions: ['ar']
options: 'informal'
expect:
name: 'Día de la Revolución de Mayo'
- given:
date: '2016-06-20'
regions: ['ar']
options: 'informal'
expect:
name: 'Día de la Bandera'
- given:
date: '2016-07-08'
regions: ['ar']
options: 'informal'
expect:
name: 'Feriado puente turístico'
- given:
date: '2016-07-09'
regions: ['ar']
options: 'informal'
expect:
name: 'Día de la Independencia'
- given:
date: '2016-08-15'
regions: ['ar']
options: 'informal'
expect:
name: 'Paso a la Inmortalidad del General José de San Martín'
- given:
date: '2016-10-12'
regions: ['ar']
options: 'informal'
expect:
name: 'Día del Respeto a la Diversidad Cultural'
- given:
date: '2016-11-20'
regions: ['ar']
options: 'informal'
expect:
name: 'Día de la Soberanía Nacional'
- given:
date: '2016-12-08'
regions: ['ar']
options: 'informal'
expect:
name: 'Inmaculada Concepción de María'
- given:
date: '2016-12-09'
regions: ['ar']
options: 'informal'
expect:
name: 'Feriado puente turístico'
- given:
date: '2016-12-25'
regions: ['ar']
options: 'informal'
expect:
name: 'Navidad'
61 changes: 48 additions & 13 deletions at.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,51 @@ months:
- name: 2. Weihnachtstag
regions: [at]
mday: 26
tests: |
{Date.civil(2009,1,1) => 'Neujahrstag',
Date.civil(2009,4,13) => 'Ostermontag',
Date.civil(2009,5,1) => 'Staatsfeiertag',
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
Date.civil(2009,6,1) => 'Pfingstmontag',
Date.civil(2009,10,26) => 'Nationalfeiertag',
Date.civil(2009,12,25) => '1. Weihnachtstag',
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
assert_equal name, (Holidays.on(date, :at, :informal)[0] || {})[:name]
end
assert_equal [], Holidays.on(Date.civil(2010,5,8), :at), '2010-05-08 is not a holiday in Austria'
tests:
- given:
date: '2009-01-01'
regions: ['at']
options: 'informal'
expect:
name: 'Neujahrstag'
- given:
date: '2009-04-13'
regions: ['at']
options: 'informal'
expect:
name: 'Ostermontag'
- given:
date: '2009-05-21'
regions: ['at']
options: 'informal'
expect:
name: 'Christi Himmelfahrt'
- given:
date: '2009-06-01'
regions: ['at']
options: 'informal'
expect:
name: 'Pfingstmontag'
- given:
date: '2009-10-26'
regions: ['at']
options: 'informal'
expect:
name: 'Nationalfeiertag'
- given:
date: '2009-12-25'
regions: ['at']
options: 'informal'
expect:
name: '1. Weihnachtstag'
- given:
date: '2009-12-26'
regions: ['at']
options: 'informal'
expect:
name: '2. Weihnachtstag'
- given:
date: '2010-05-08'
regions: ['at']
expect:
holiday: false
Loading

0 comments on commit 0656cf4

Please sign in to comment.