calendarium-romanum 0.5.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +5 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +50 -0
  5. data/.travis.yml +23 -0
  6. data/.yardopts +3 -0
  7. data/Appraisals +67 -0
  8. data/CHANGELOG.md +488 -0
  9. data/Gemfile +26 -0
  10. data/Gemfile.lock +95 -0
  11. data/README.md +601 -0
  12. data/Rakefile +27 -0
  13. data/bin/calendariumrom +3 -0
  14. data/calendarium-romanum.gemspec +31 -0
  15. data/config/locales/cs.yml +4 -0
  16. data/config/locales/en.yml +20 -14
  17. data/config/locales/es.yml +94 -0
  18. data/config/locales/fr.yml +6 -0
  19. data/config/locales/it.yml +6 -0
  20. data/config/locales/la.yml +6 -0
  21. data/config/locales/pt.yml +94 -0
  22. data/data/README.md +70 -24
  23. data/data/czech-brno-cs.txt +4 -6
  24. data/data/czech-budejovice-cs.txt +4 -6
  25. data/data/czech-cechy-cs.txt +4 -5
  26. data/data/czech-cs.txt +239 -235
  27. data/data/czech-hradec-cs.txt +3 -5
  28. data/data/czech-litomerice-cs.txt +5 -7
  29. data/data/czech-morava-cs.txt +4 -5
  30. data/data/czech-olomouc-cs.txt +2 -4
  31. data/data/czech-ostrava-cs.txt +3 -5
  32. data/data/czech-plzen-cs.txt +3 -5
  33. data/data/czech-praha-cs.txt +3 -4
  34. data/data/easter_dates.txt +67 -0
  35. data/data/universal-1969-la.txt +234 -0
  36. data/data/universal-en.txt +217 -211
  37. data/data/universal-es.txt +246 -0
  38. data/data/universal-fr.txt +217 -210
  39. data/data/universal-it.txt +217 -211
  40. data/data/universal-la.txt +217 -212
  41. data/data/universal-pt.txt +248 -0
  42. data/doc/data_readme.md +2 -0
  43. data/doc/images/class_diagram.png +0 -0
  44. data/doc/images/class_diagram.puml +44 -0
  45. data/doc/yard_readme.rdoc +76 -0
  46. data/lib/calendarium-romanum.rb +16 -2
  47. data/lib/calendarium-romanum/abstract_date.rb +15 -0
  48. data/lib/calendarium-romanum/calendar.rb +150 -33
  49. data/lib/calendarium-romanum/cli.rb +80 -100
  50. data/lib/calendarium-romanum/cli/comparator.rb +83 -0
  51. data/lib/calendarium-romanum/cli/date_parser.rb +30 -0
  52. data/lib/calendarium-romanum/cli/dumper.rb +68 -0
  53. data/lib/calendarium-romanum/cli/helper.rb +23 -0
  54. data/lib/calendarium-romanum/cli/querier.rb +73 -0
  55. data/lib/calendarium-romanum/cr.rb +16 -0
  56. data/lib/calendarium-romanum/data.rb +40 -8
  57. data/lib/calendarium-romanum/day.rb +187 -32
  58. data/lib/calendarium-romanum/enum.rb +41 -24
  59. data/lib/calendarium-romanum/enums.rb +127 -43
  60. data/lib/calendarium-romanum/errors.rb +1 -1
  61. data/lib/calendarium-romanum/ordinalizer.rb +10 -1
  62. data/lib/calendarium-romanum/perpetual_calendar.rb +58 -7
  63. data/lib/calendarium-romanum/rank.rb +39 -8
  64. data/lib/calendarium-romanum/rank_predicates.rb +43 -0
  65. data/lib/calendarium-romanum/sanctorale.rb +213 -23
  66. data/lib/calendarium-romanum/sanctorale_factory.rb +74 -3
  67. data/lib/calendarium-romanum/sanctorale_loader.rb +180 -0
  68. data/lib/calendarium-romanum/sanctorale_writer.rb +124 -0
  69. data/lib/calendarium-romanum/temporale.rb +222 -42
  70. data/lib/calendarium-romanum/temporale/celebration_factory.rb +68 -9
  71. data/lib/calendarium-romanum/temporale/date_helper.rb +85 -0
  72. data/lib/calendarium-romanum/temporale/dates.rb +52 -59
  73. data/lib/calendarium-romanum/temporale/easter_table.rb +27 -0
  74. data/lib/calendarium-romanum/temporale/extensions.rb +15 -0
  75. data/lib/calendarium-romanum/temporale/extensions/christ_eternal_priest.rb +16 -3
  76. data/lib/calendarium-romanum/temporale/extensions/dedication_before_all_saints.rb +73 -0
  77. data/lib/calendarium-romanum/transfers.rb +84 -24
  78. data/lib/calendarium-romanum/util.rb +21 -23
  79. data/lib/calendarium-romanum/version.rb +3 -2
  80. data/liturgical_law/1969_normae_universales.md +568 -0
  81. data/liturgical_law/1977_decretum_de_celebratione_baptismatis_domini.md +58 -0
  82. data/liturgical_law/1990_decretum_de_variatione_inducenda.md +67 -0
  83. data/liturgical_law/1998_notificatio_de_occurrentia.md +57 -0
  84. data/liturgical_law/2002_normae_universales.md +946 -0
  85. data/liturgical_law/2006_notification.md +37 -0
  86. data/liturgical_law/2012_declarationes.md +38 -0
  87. data/liturgical_law/2020_dubia_de_calendario_2022.md +100 -0
  88. data/liturgical_law/README.md +74 -0
  89. metadata +61 -38
  90. data/lib/calendarium-romanum/sanctoraleloader.rb +0 -122
  91. data/spec/abstract_date_spec.rb +0 -62
  92. data/spec/calendar_spec.rb +0 -559
  93. data/spec/celebration_factory_spec.rb +0 -16
  94. data/spec/celebration_spec.rb +0 -43
  95. data/spec/cli_spec.rb +0 -155
  96. data/spec/colour_spec.rb +0 -17
  97. data/spec/data_spec.rb +0 -23
  98. data/spec/date_parser_spec.rb +0 -68
  99. data/spec/date_spec.rb +0 -61
  100. data/spec/dates_spec.rb +0 -45
  101. data/spec/day_spec.rb +0 -108
  102. data/spec/enum_spec.rb +0 -51
  103. data/spec/i18n_spec.rb +0 -58
  104. data/spec/ordinalizer_spec.rb +0 -36
  105. data/spec/perpetual_calendar_spec.rb +0 -91
  106. data/spec/rank_spec.rb +0 -57
  107. data/spec/readme_spec.rb +0 -56
  108. data/spec/sanctorale_factory_spec.rb +0 -42
  109. data/spec/sanctorale_spec.rb +0 -191
  110. data/spec/sanctoraleloader_spec.rb +0 -176
  111. data/spec/season_spec.rb +0 -17
  112. data/spec/spec_helper.rb +0 -46
  113. data/spec/temporale_spec.rb +0 -572
@@ -1,176 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe CR::SanctoraleLoader do
4
- before :each do
5
- @s = CR::Sanctorale.new
6
- @l = CR::SanctoraleLoader.new
7
- end
8
-
9
- describe 'data sources' do
10
- describe '#load_from_string' do
11
- before :each do
12
- str = '1/3 : Ss.mi Nominis Iesu'
13
- @l.load_from_string str, @s
14
- end
15
-
16
- it 'loads one entry' do
17
- expect(@s.size).to eq 1
18
- end
19
-
20
- it 'loads date correctly' do
21
- expect(@s.get(1, 3).size).to eq 1
22
- end
23
-
24
- it 'loads title correctly' do
25
- expect(@s.get(1, 3)[0].title).to eq 'Ss.mi Nominis Iesu'
26
- end
27
-
28
- it 'sets default rank' do
29
- expect(@s.get(1, 3)[0].rank).to eq CR::Ranks::MEMORIAL_OPTIONAL
30
- end
31
-
32
- it 'sets default colour - white' do
33
- expect(@s.get(1, 3)[0].colour).to eq CR::Colours::WHITE
34
- end
35
-
36
- it 'loads explicit rank if given' do
37
- str = '1/25 f : In conversione S. Pauli, apostoli'
38
- @l.load_from_string str, @s
39
- expect(@s.get(1, 25)[0].rank).to eq CR::Ranks::FEAST_GENERAL
40
- end
41
- end
42
-
43
- describe '#load_from_file' do
44
- it 'loads something from file' do
45
- @l.load_from_file(File.join(%w(data universal-la.txt)), @s)
46
- expect(@s.size).to be > 190
47
- end
48
- end
49
- end
50
-
51
- describe 'record/file format' do
52
- describe 'month as heading' do
53
- it 'loads a month heading and uses the month for subsequent records' do
54
- str = ['= 1', '25 f : In conversione S. Pauli, apostoli'].join "\n"
55
- @l.load_from_string str, @s
56
- expect(@s).not_to be_empty
57
- expect(@s.get(1, 25)).not_to be_empty
58
- end
59
- end
60
-
61
- describe 'colour' do
62
- it 'sets colour if specified' do
63
- str = '4/25 f R : S. Marci, evangelistae'
64
- @l.load_from_string str, @s
65
- expect(@s.get(4, 25).first.colour).to eq CR::Colours::RED
66
- end
67
-
68
- it 'sets colour if specified (lowercase)' do
69
- str = '4/25 f r : S. Marci, evangelistae'
70
- @l.load_from_string str, @s
71
- expect(@s.get(4, 25).first.colour).to eq CR::Colours::RED
72
- end
73
- end
74
-
75
- describe 'rank' do
76
- # say we specify a proper calendar of a church dedicated to St. George
77
-
78
- it 'sets rank if specified' do
79
- str = '4/23 s R : S. Georgii, martyris'
80
- @l.load_from_string str, @s
81
- celeb = @s.get(4, 23).first
82
- expect(celeb.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
83
- end
84
-
85
- it 'sets rank if specified (uppercase)' do
86
- str = '4/23 S R : S. Georgii, martyris'
87
- @l.load_from_string str, @s
88
- celeb = @s.get(4, 23).first
89
- expect(celeb.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
90
- end
91
-
92
- it 'sets exact rank if specified' do
93
- str = '4/23 s1.4 R : S. Georgii, martyris'
94
- @l.load_from_string str, @s
95
- celeb = @s.get(4, 23).first
96
- expect(celeb.rank).to eq CR::Ranks::SOLEMNITY_PROPER
97
- end
98
-
99
- it 'sets exact rank if specified only by number' do
100
- str = '4/23 1.4 R : S. Georgii, martyris'
101
- @l.load_from_string str, @s
102
- celeb = @s.get(4, 23).first
103
- expect(celeb.rank).to eq CR::Ranks::SOLEMNITY_PROPER
104
- end
105
- end
106
- end
107
-
108
- describe 'invalid input' do
109
- describe 'syntax errors' do
110
- it 'invalid syntax' do
111
- str = 'line without standard beginning'
112
- expect do
113
- @l.load_from_string str, @s
114
- end.to raise_exception(CR::InvalidDataError, /Syntax error/)
115
- end
116
- end
117
-
118
- describe 'syntactically correct data making no sense' do
119
- it 'invalid month heading' do
120
- str = '= 13'
121
- expect do
122
- @l.load_from_string str, @s
123
- end.to raise_exception(CR::InvalidDataError, /Invalid month/)
124
- end
125
-
126
- it 'invalid month' do
127
- str = '100/25 f : In conversione S. Pauli, apostoli'
128
- expect do
129
- @l.load_from_string str, @s
130
- end.to raise_exception(CR::InvalidDataError, /Invalid month/)
131
- end
132
-
133
- it 'line with day only, without preceding month heading' do
134
- str = '25 f : In conversione S. Pauli, apostoli'
135
- expect do
136
- @l.load_from_string str, @s
137
- end.to raise_exception(CR::InvalidDataError, /Invalid month/)
138
- end
139
-
140
- it 'invalid day' do
141
- str = '1/250 f : In conversione S. Pauli, apostoli'
142
- expect do
143
- @l.load_from_string str, @s
144
- end.to raise_exception(CR::InvalidDataError, /Invalid day/)
145
- end
146
-
147
- it 'invalid month heading' do
148
- str = '= 0'
149
- expect do
150
- @l.load_from_string str, @s
151
- end.to raise_exception(CR::InvalidDataError, /Invalid month/)
152
- end
153
-
154
- it 'invalid rank' do
155
- str = '1/25 X : In conversione S. Pauli, apostoli'
156
- expect do
157
- @l.load_from_string str, @s
158
- end.to raise_exception(CR::InvalidDataError, /Syntax error/)
159
- end
160
-
161
- it 'invalid numeric rank' do
162
- str = '4/23 s8.4 R : S. Georgii, martyris'
163
- expect do
164
- @l.load_from_string str, @s
165
- end.to raise_exception(CR::InvalidDataError, /rank/)
166
- end
167
-
168
- it 'invalid combination of rank latter and number' do
169
- str = '4/23 m2.5 R : S. Georgii, martyris'
170
- expect do
171
- @l.load_from_string str, @s
172
- end.to raise_exception(CR::InvalidDataError, /rank/)
173
- end
174
- end
175
- end
176
- end
data/spec/season_spec.rb DELETED
@@ -1,17 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe CR::Season do
4
- CR::Seasons.each do |season|
5
- describe season do
6
- describe '#name' do
7
- it { expect(season.name).to have_translation }
8
- end
9
- end
10
- end
11
-
12
- describe 'indexing' do
13
- it 'is indexed by symbol' do
14
- expect(CR::Seasons[:lent]).to be CR::Seasons::LENT
15
- end
16
- end
17
- end
data/spec/spec_helper.rb DELETED
@@ -1,46 +0,0 @@
1
- require 'simplecov'
2
- SimpleCov.start do
3
- add_filter 'lib/calendarium-romanum/cli.rb'
4
- end
5
-
6
- require 'aruba/rspec'
7
-
8
- # This file was generated by the `rspec --init` command. Conventionally, all
9
- # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
10
- # Require this file using `require "spec_helper"` to ensure that it is only
11
- # loaded once.
12
- #
13
- # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
14
- RSpec.configure do |config|
15
- config.run_all_when_everything_filtered = true
16
- config.filter_run :focus
17
-
18
- # Run specs in random order to surface order dependencies. If you find an
19
- # order dependency and want to debug it, you can fix the order by providing
20
- # the seed, which is printed after each run.
21
- # --seed 1234
22
- config.order = 'random'
23
- end
24
-
25
- RSpec::Matchers.define :have_translation do |expected, locale|
26
- match do |actual|
27
- locale ||= :en
28
- if expected && I18n.locale == locale
29
- actual == expected
30
- else
31
- # with locale different from the one the spec is written for
32
- # just test that the string isn't left untranslated
33
- !(actual.nil? || actual.empty? || actual.include?('translation missing'))
34
- end
35
- end
36
- end
37
-
38
- require 'calendarium-romanum'
39
- CR = CalendariumRomanum
40
-
41
- I18n.enforce_available_locales = true
42
- I18n.locale = ENV['LOCALE'] || :en
43
-
44
- # make the gem's executable(s) easily available for aruba
45
- gem_bin = File.expand_path('../../bin', __FILE__)
46
- ENV['PATH'] = "#{gem_bin}:#{ENV['PATH']}"
@@ -1,572 +0,0 @@
1
- # coding: utf-8
2
- require_relative 'spec_helper'
3
-
4
- describe CR::Temporale do
5
- before :all do
6
- @t = @t12 = described_class.new 2012
7
- @t13 = described_class.new 2013
8
- end
9
-
10
- describe '.liturgical_year' do
11
- it 'returns liturgical year for the given date' do
12
- [
13
- [Date.new(2014, 11, 1), 2013],
14
- [Date.new(2014, 12, 1), 2014]
15
- ].each do |date, year|
16
- expect(described_class.liturgical_year(date)).to eq year
17
- end
18
- end
19
- end
20
-
21
- describe '#first_advent_sunday determines first Sunday of Advent' do
22
- [
23
- [2004, [11, 28]],
24
- [2010, [11, 28]],
25
- [2011, [11, 27]],
26
- [2012, [12, 2]],
27
- [2013, [12, 1]]
28
- ].each do |d|
29
- year, date = d
30
- it year do
31
- temporale = described_class.new(year)
32
- expect(temporale.first_advent_sunday).to eq Date.new(year, *date)
33
- end
34
- end
35
- end
36
-
37
- describe '#easter_sunday determines Easter Sunday' do
38
- [
39
- [2003, [2004, 4, 11]],
40
- [2004, [2005, 3, 27]],
41
- [2005, [2006, 4, 16]],
42
- [2006, [2007, 4, 8]],
43
- [2014, [2015, 4, 5]]
44
- ].each do |d|
45
- year, date = d
46
- it year do
47
- temporale = described_class.new(year)
48
- expect(temporale.easter_sunday).to eq Date.new(*date)
49
- end
50
- end
51
- end
52
-
53
- describe '#date_range' do
54
- it 'includes days of the year' do
55
- expect(@t.date_range).to include Date.new(2012, 12, 3)
56
- expect(@t.date_range).to include Date.new(2013, 11, 5)
57
- end
58
- end
59
-
60
- describe '#season' do
61
- it 'determines Advent' do
62
- expect(@t13.season(Date.new(2013, 12, 1))).to eq CR::Seasons::ADVENT
63
- expect(@t13.season(Date.new(2013, 12, 24))).to eq CR::Seasons::ADVENT
64
- end
65
-
66
- it 'determines Christmas' do
67
- expect(@t13.season(Date.new(2013, 12, 25))).to eq CR::Seasons::CHRISTMAS
68
- expect(@t13.season(Date.new(2014, 1, 12))).to eq CR::Seasons::CHRISTMAS
69
- expect(@t13.season(Date.new(2014, 1, 13))).to eq CR::Seasons::ORDINARY
70
- end
71
-
72
- it 'determines Lent' do
73
- expect(@t13.season(Date.new(2014, 3, 4))).to eq CR::Seasons::ORDINARY
74
- expect(@t13.season(Date.new(2014, 3, 5))).to eq CR::Seasons::LENT
75
- expect(@t13.season(Date.new(2014, 4, 19))).to eq CR::Seasons::LENT
76
- expect(@t13.season(Date.new(2014, 4, 20))).to eq CR::Seasons::EASTER
77
- end
78
-
79
- it 'determines Easter time' do
80
- expect(@t13.season(Date.new(2014, 4, 20))).to eq CR::Seasons::EASTER
81
- expect(@t13.season(Date.new(2014, 6, 8))).to eq CR::Seasons::EASTER
82
- expect(@t13.season(Date.new(2014, 6, 9))).to eq CR::Seasons::ORDINARY
83
- end
84
- end
85
-
86
- describe '#season_beginning' do
87
- let(:year) { 2016 }
88
- let(:options) { {} }
89
- let(:t) { described_class.new(year, **options) }
90
-
91
- describe 'unsupported season' do
92
- it 'fails' do
93
- season = CR::Season.new(:strawberry_season, CR::Colours::RED)
94
- expect do
95
- t.season_beginning season
96
- end.to raise_exception(ArgumentError, /unsupported season/)
97
- end
98
- end
99
-
100
- describe 'Ordinary Time' do
101
- describe 'Epiphany not transferred' do
102
- it do
103
- expect(t.season_beginning(CR::Seasons::ORDINARY))
104
- .to eq Date.new(2017, 1, 9)
105
- end
106
- end
107
-
108
- describe 'Epiphany transferred' do
109
- let(:t) { described_class.new(year, transfer_to_sunday: [:epiphany]) }
110
-
111
- it do
112
- expect(t.season_beginning(CR::Seasons::ORDINARY))
113
- .to eq Date.new(2017, 1, 10)
114
- end
115
- end
116
- end
117
- end
118
-
119
- describe '#get' do
120
- it 'returns a Celebration' do
121
- expect(@t13.get(8, 12)).to be_a CR::Celebration
122
- end
123
-
124
- describe 'for' do
125
- describe 'ferial' do
126
- it 'in Ordinary Time' do
127
- c = @t13.get(8, 12)
128
- expect(c.rank).to eq CR::Ranks::FERIAL
129
- expect(c.color).to eq CR::Colours::GREEN
130
- end
131
-
132
- it 'in Advent' do
133
- c = @t13.get(12, 12)
134
- expect(c.rank).to eq CR::Ranks::FERIAL
135
- expect(c.color).to eq CR::Colours::VIOLET
136
- end
137
-
138
- it 'in the last week of Advent' do
139
- c = @t13.get(12, 23)
140
- expect(c.rank).to eq CR::Ranks::FERIAL_PRIVILEGED
141
- expect(c.color).to eq CR::Colours::VIOLET
142
- end
143
-
144
- it 'in Christmas time' do
145
- c = @t13.get(1, 3)
146
- expect(c.rank).to eq CR::Ranks::FERIAL
147
- expect(c.color).to eq CR::Colours::WHITE
148
- end
149
-
150
- it 'in Lent' do
151
- c = @t13.get(3, 18)
152
- expect(c.rank).to eq CR::Ranks::FERIAL_PRIVILEGED
153
- expect(c.color).to eq CR::Colours::VIOLET
154
- end
155
-
156
- it 'in Easter Time' do
157
- c = @t13.get(5, 5)
158
- expect(c.rank).to eq CR::Ranks::FERIAL
159
- expect(c.color).to eq CR::Colours::WHITE
160
- end
161
- end
162
-
163
- describe 'Sunday' do
164
- it 'in Ordinary Time' do
165
- c = @t13.get(8, 10)
166
- expect(c.rank).to eq CR::Ranks::SUNDAY_UNPRIVILEGED
167
- expect(c.color).to eq CR::Colours::GREEN
168
- end
169
-
170
- it 'in Advent' do
171
- c = @t13.get(12, 15)
172
- expect(c.rank).to eq CR::Ranks::PRIMARY
173
- expect(c.color).to eq CR::Colours::VIOLET
174
- end
175
-
176
- it 'in Christmas time' do
177
- c = @t13.get(1, 5)
178
- expect(c.rank).to eq CR::Ranks::SUNDAY_UNPRIVILEGED
179
- expect(c.color).to eq CR::Colours::WHITE
180
- end
181
-
182
- it 'in Lent' do
183
- c = @t13.get(3, 23)
184
- expect(c.rank).to eq CR::Ranks::PRIMARY
185
- expect(c.color).to eq CR::Colours::VIOLET
186
- end
187
-
188
- it 'in Easter Time' do
189
- c = @t13.get(5, 11)
190
- expect(c.rank).to eq CR::Ranks::PRIMARY
191
- expect(c.color).to eq CR::Colours::WHITE
192
- end
193
- end
194
-
195
- describe 'solemnities and their cycles - ' do
196
- it 'end of Advent time' do
197
- c = @t13.get(12, 17)
198
- expect(c.rank).to eq CR::Ranks::FERIAL_PRIVILEGED
199
- expect(c.colour).to eq CR::Colours::VIOLET
200
- end
201
-
202
- it 'Nativity' do
203
- c = @t13.get(12, 25)
204
- expect(c.rank).to eq CR::Ranks::PRIMARY
205
- expect(c.title).to have_translation 'The Nativity of the Lord'
206
- expect(c.colour).to eq CR::Colours::WHITE
207
- expect(c.symbol).to eq :nativity
208
- end
209
-
210
- it 'day in the octave of Nativity' do
211
- c = @t13.get(12, 27)
212
- expect(c.rank).to eq CR::Ranks::FERIAL_PRIVILEGED
213
- expect(c.colour).to eq CR::Colours::WHITE
214
- end
215
-
216
- it 'Holy Family' do
217
- c = @t13.get(12, 29)
218
- expect(c.rank).to eq CR::Ranks::FEAST_LORD_GENERAL
219
- expect(c.title).to have_translation 'The Holy Family of Jesus, Mary and Joseph'
220
- expect(c.colour).to eq CR::Colours::WHITE
221
- end
222
-
223
- context 'when a Sunday does not occur between Dec 25 and Jan 1' do
224
- it 'is Holy Family on Friday Dec 30' do
225
- @t16 = described_class.new 2016
226
- c = @t16.get(12, 30)
227
- expect(c.title).to have_translation 'The Holy Family of Jesus, Mary and Joseph'
228
- end
229
- end
230
-
231
- it 'Epiphany' do
232
- c = @t13.get(1, 6)
233
- expect(c.rank).to eq CR::Ranks::PRIMARY
234
- expect(c.title).to have_translation 'The Epiphany of the Lord'
235
- expect(c.colour).to eq CR::Colours::WHITE
236
- end
237
-
238
- it 'Baptism of the Lord' do
239
- c = @t13.get(1, 12)
240
- expect(c.rank).to eq CR::Ranks::FEAST_LORD_GENERAL
241
- expect(c.title).to have_translation 'The Baptism of the Lord'
242
- expect(c.colour).to eq CR::Colours::WHITE
243
- end
244
-
245
- it 'Ash Wednesday' do
246
- c = @t13.get(3, 5)
247
- expect(c.rank).to eq CR::Ranks::PRIMARY
248
- expect(c.title).to have_translation 'Ash Wednesday'
249
- expect(c.colour).to eq CR::Colours::VIOLET
250
- end
251
-
252
- it 'Palm Sunday' do
253
- c = @t13.get(4, 13)
254
- expect(c.rank).to eq CR::Ranks::PRIMARY
255
- expect(c.title).to have_translation 'Palm Sunday of the Passion of the Lord'
256
- expect(c.colour).to eq CR::Colours::RED
257
- end
258
-
259
- it 'Good Friday' do
260
- c = @t13.get(4, 18)
261
- expect(c.rank).to eq CR::Ranks::TRIDUUM
262
- expect(c.title).to have_translation 'Friday of the Passion of the Lord'
263
- expect(c.colour).to eq CR::Colours::RED
264
- end
265
-
266
- it 'Holy Saturday' do
267
- c = @t13.get(4, 19)
268
- expect(c.rank).to eq CR::Ranks::TRIDUUM
269
- expect(c.title).to have_translation 'Holy Saturday'
270
- expect(c.colour).to eq CR::Colours::VIOLET
271
- end
272
-
273
- it 'Resurrection' do
274
- c = @t13.get(4, 20)
275
- expect(c.rank).to eq CR::Ranks::TRIDUUM
276
- expect(c.title).to have_translation 'Easter Sunday of the Resurrection of the Lord'
277
- expect(c.colour).to eq CR::Colours::WHITE
278
- expect(c.symbol).to eq :easter_sunday
279
- end
280
-
281
- it 'Ascension' do
282
- c = @t13.get(5, 29)
283
- expect(c.rank).to eq CR::Ranks::PRIMARY
284
- expect(c.title).to have_translation 'Ascension of the Lord'
285
- expect(c.colour).to eq CR::Colours::WHITE
286
- end
287
-
288
- it 'Pentecost' do
289
- c = @t13.get(6, 8)
290
- expect(c.rank).to eq CR::Ranks::PRIMARY
291
- expect(c.title).to have_translation 'Pentecost Sunday'
292
- expect(c.colour).to eq CR::Colours::RED
293
- expect(c.symbol).to eq :pentecost
294
- end
295
-
296
- it 'Trinity' do
297
- c = @t13.get(6, 15)
298
- expect(c.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
299
- expect(c.title).to have_translation 'The Most Holy Trinity'
300
- expect(c.colour).to eq CR::Colours::WHITE
301
- end
302
-
303
- it 'Body of Christ' do
304
- c = @t13.get(6, 19)
305
- expect(c.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
306
- expect(c.title).to have_translation 'The Most Holy Body and Blood of Christ'
307
- expect(c.colour).to eq CR::Colours::WHITE
308
- end
309
-
310
- it 'Sacred Heart' do
311
- c = @t13.get(6, 27)
312
- expect(c.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
313
- expect(c.title).to have_translation 'The Most Sacred Heart of Jesus'
314
- expect(c.colour).to eq CR::Colours::WHITE
315
- end
316
-
317
- it 'Christ the King' do
318
- c = @t13.get(11, 23)
319
- expect(c.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
320
- expect(c.title).to have_translation 'Our Lord Jesus Christ, King of the Universe'
321
- expect(c.colour).to eq CR::Colours::WHITE
322
- end
323
-
324
- describe 'other locales' do
325
- it 'Latin' do
326
- I18n.with_locale(:la) do
327
- c = @t13.get(11, 23)
328
- expect(c.title).to eq 'Domini nostri Iesu Christi universorum regis'
329
- end
330
- end
331
-
332
- it 'Czech' do
333
- I18n.with_locale(:cs) do
334
- c = @t13.get(11, 23)
335
- expect(c.title).to eq 'Ježíše Krista krále'
336
- end
337
- end
338
-
339
- it 'Italian' do
340
- I18n.with_locale(:it) do
341
- c = @t13.get(11, 23)
342
- expect(c.title).to eq "Nostro Signore Gesù Cristo Re dell'universo"
343
- end
344
- end
345
- end
346
- end
347
-
348
- # movable sanctorale feasts don't really belong in Temporale, but ...
349
- describe 'movable sanctorale feasts' do
350
- it 'Immaculate Heart' do
351
- c = @t13.get(6, 28)
352
- expect(c.title).to have_translation 'Immaculate Heart of Mary'
353
- expect(c.rank).to eq CR::Ranks::MEMORIAL_GENERAL
354
- end
355
- end
356
- end
357
-
358
- describe 'titles of Sundays and ferials' do
359
- def title_for(month, day)
360
- @t13.get(month, day).title
361
- end
362
-
363
- describe 'Ordinary time' do
364
- it 'Sunday' do
365
- expect(title_for(1, 19)).to have_translation '2nd Sunday in Ordinary Time'
366
- end
367
-
368
- it 'ferial' do
369
- expect(title_for(1, 13)).to have_translation 'Monday, 1st week in Ordinary Time'
370
- end
371
- end
372
-
373
- describe 'Advent' do
374
- it 'Sunday' do
375
- expect(title_for(12, 1)).to have_translation '1st Sunday of Advent'
376
- end
377
-
378
- it 'ferial' do
379
- expect(title_for(12, 2)).to have_translation 'Monday, 1st week of Advent'
380
- end
381
-
382
- it 'ferial before Christmas' do
383
- expect(title_for(12, 17)).to have_translation '17th December'
384
- end
385
- end
386
-
387
- describe 'Christmas time' do
388
- describe 'Octave of Christmas' do
389
- it 'ferial' do
390
- day = @t13.get(12, 30)
391
- expect(day.rank).to eq CR::Ranks::FERIAL_PRIVILEGED
392
- expect(day.title).to have_translation '6th day of Christmas Octave'
393
- end
394
- end
395
-
396
- describe 'after Octave of Christmas' do
397
- it 'ferial' do
398
- expect(title_for(1, 2)).to have_translation 'Thursday after Christmas Octave'
399
- end
400
-
401
- it 'Sunday' do
402
- expect(title_for(1, 5)).to have_translation '2nd Sunday after the Nativity of the Lord'
403
- end
404
- end
405
-
406
- describe 'after Epiphany' do
407
- it 'ferial' do
408
- expect(title_for(1, 7)).to have_translation 'Tuesday after Epiphany'
409
- end
410
- end
411
- end
412
-
413
- describe 'Lent' do
414
- describe 'before first Sunday' do
415
- it 'ferial' do
416
- expect(title_for(3, 6)).to have_translation 'Thursday after Ash Wednesday'
417
- end
418
- end
419
-
420
- it 'Sunday' do
421
- expect(title_for(3, 9)).to have_translation '1st Sunday of Lent'
422
- end
423
-
424
- it 'ferial' do
425
- expect(title_for(3, 10)).to have_translation 'Monday, 1st week of Lent'
426
- end
427
-
428
- describe 'Holy Week' do
429
- it 'ferial' do
430
- day = @t13.get(4, 14)
431
- expect(day.rank).to eq CR::Ranks::PRIMARY
432
- expect(day.title).to have_translation 'Monday of Holy Week'
433
- end
434
- end
435
- end
436
-
437
- describe 'Easter' do
438
- describe 'Easter Octave' do
439
- it 'ferial' do
440
- c = @t13.get(4, 22)
441
- expect(c.rank).to eq CR::Ranks::PRIMARY
442
- expect(c.title).to have_translation 'Easter Tuesday'
443
- end
444
-
445
- it 'Sunday (the octave day)' do
446
- c = @t13.get(4, 27)
447
- expect(c.rank).to eq CR::Ranks::PRIMARY
448
- expect(c.title).to have_translation '2nd Sunday of Easter'
449
- end
450
- end
451
-
452
- it 'Sunday' do
453
- expect(title_for(5, 4)).to have_translation '3rd Sunday of Easter'
454
- end
455
-
456
- it 'ferial' do
457
- expect(title_for(5, 5)).to have_translation 'Monday, 3rd week of Easter'
458
- end
459
- end
460
-
461
- describe 'other locales' do
462
- it 'Latin' do
463
- I18n.with_locale(:la) do
464
- expect(title_for(5, 5)).to eq 'Feria secunda, hebdomada III temporis paschalis'
465
- end
466
- end
467
-
468
- it 'Czech' do
469
- I18n.with_locale(:cs) do
470
- expect(title_for(5, 5)).to eq 'Pondělí po 3. neděli velikonoční'
471
- end
472
- end
473
-
474
- it 'French' do
475
- I18n.with_locale(:fr) do
476
- expect(title_for(5, 5)).to eq 'Lundi, 3ème semaine de Pâques'
477
- end
478
- end
479
-
480
- it 'Italian' do
481
- I18n.with_locale(:it) do
482
- expect(title_for(5, 5)).to eq 'Lunedì, III di Pasqua'
483
- end
484
- end
485
- end
486
- end
487
- end
488
-
489
- describe 'packaged extensions' do
490
- describe 'ChristEternalPriest' do
491
- let(:t) { described_class.new(2016, extensions: [CR::Temporale::Extensions::ChristEternalPriest]) }
492
-
493
- it 'adds the feast' do
494
- I18n.with_locale(:cs) do
495
- c = t.get(6, 8)
496
- expect(c.title).to eq 'Ježíše Krista, nejvyššího a věčného kněze'
497
- expect(c.rank).to eq CR::Ranks::FEAST_PROPER
498
- expect(c.colour).to eq CR::Colours::WHITE
499
- end
500
- end
501
- end
502
- end
503
-
504
- describe 'Solemnities transferred to a Sunday' do
505
- let(:year) { 2016 }
506
- let(:transferred) { [:epiphany, :ascension, :corpus_christi] }
507
- let(:t) { described_class.new(year, transfer_to_sunday: transferred) }
508
- let(:t_notransfer) { described_class.new(year) }
509
-
510
- it 'Epiphany' do
511
- date = Date.new(2017, 1, 8)
512
- expect(date).to be_sunday # make sure
513
-
514
- expect(t.epiphany).to eq date
515
-
516
- c = t.get(date)
517
- expect(c.rank).to eq CR::Ranks::PRIMARY
518
- expect(c.title).to have_translation 'The Epiphany of the Lord'
519
- end
520
-
521
- it 'Baptism of the Lord after transferred Epiphany' do
522
- date = Date.new(2017, 1, 9)
523
- expect(date).to be_monday # make sure
524
-
525
- expect(t.baptism_of_lord).to eq date
526
-
527
- c = t.get(date)
528
- expect(c.rank).to eq CR::Ranks::FEAST_LORD_GENERAL
529
- expect(c.title).to have_translation 'The Baptism of the Lord'
530
- end
531
-
532
- describe 'Ordinary Time numbering after transferred Epiphany' do
533
- it 'ferials correct' do
534
- first_ot_tuesday = Date.new(2017, 1, 10)
535
- expect(t.get(first_ot_tuesday)).to eq t_notransfer.get(first_ot_tuesday)
536
- end
537
-
538
- it 'Sundays correct' do
539
- second_ot_sunday = Date.new(2017, 1, 15)
540
- expect(t.get(second_ot_sunday)).to eq t_notransfer.get(second_ot_sunday)
541
- end
542
- end
543
-
544
- it 'Ascension' do
545
- date = Date.new(2017, 5, 28)
546
- expect(date).to be_sunday # make sure
547
-
548
- expect(t.ascension).to eq date
549
-
550
- c = t.get(date)
551
- expect(c.rank).to eq CR::Ranks::PRIMARY
552
- expect(c.title).to have_translation 'Ascension of the Lord'
553
- end
554
-
555
- it 'Corpus Christi' do
556
- date = Date.new(2017, 6, 18)
557
- expect(date).to be_sunday # make sure
558
-
559
- expect(t.corpus_christi).to eq date
560
-
561
- c = t.get(date)
562
- expect(c.rank).to eq CR::Ranks::SOLEMNITY_GENERAL
563
- expect(c.title).to have_translation 'The Most Holy Body and Blood of Christ'
564
- end
565
-
566
- it 'fails on an unsupported solemnity' do
567
- expect do
568
- described_class.new(2016, transfer_to_sunday: [:sacred_heart])
569
- end.to raise_exception(RuntimeError, /not supported/)
570
- end
571
- end
572
- end