Skip to content

Commit dafa4dd

Browse files
committed
Add christmas_day kata
1 parent 70d2204 commit dafa4dd

File tree

3 files changed

+113
-0
lines changed

3 files changed

+113
-0
lines changed

katas/3-christmas_day/README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# The Ghost of Christmas Past
2+
3+
Christmas this year falls on a Wednesday!
4+
5+
But on which day did Christmas fall in years past?
6+
7+
## Problem Description
8+
9+
Write a Ruby class that returns the correct weekday of Christmas Day for years past.
10+
11+
## Requirements and Constraints
12+
13+
### Requirements
14+
15+
Your code should return the day of the week that Christmas Day was:
16+
- Officially celebrated
17+
- In England
18+
- Using the relative local date and time
19+
20+
### Constraints
21+
22+
**You may not use Ruby's Date, Time or any other third party library to perform date computations for you**.
23+
24+
### Input Specifications
25+
26+
See the attached tests.
27+
28+
### Output Specifications
29+
30+
See the attached tests. All tests must pass!
31+
32+
## Examples and Test Cases
33+
34+
See the attached tests.
35+
36+
## Getting started
37+
38+
1. Make sure your local repository is up to date with origin and you are on the `main` branch.
39+
2. `bin/cleo_katas attempt christmas_day`
40+
3. `ruby katas/3-christmas_day/[yourname]/test.rb`
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require 'bundler/inline'
2+
require 'date'
3+
gemfile do
4+
source 'https://rubygems.org'
5+
gem 'minitest'
6+
end
7+
8+
class ChristmasDay
9+
end
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
require_relative 'main'
2+
require 'minitest/autorun'
3+
4+
class ChristmasDayTest < Minitest::Test
5+
def test_returns_the_correct_weekday_for_2024
6+
skip 'Not implemented'
7+
assert_equal 'Wednesday', ChristmasDay.new(2024).weekday
8+
end
9+
10+
def test_returns_the_correct_weekday_for_2001
11+
skip 'Not implemented'
12+
assert_equal 'Tuesday', ChristmasDay.new(2001).weekday
13+
end
14+
15+
def test_returns_the_correct_weekday_for_1900
16+
skip 'Not implemented'
17+
assert_equal 'Tuesday', ChristmasDay.new(1900).weekday
18+
end
19+
20+
def test_returns_the_correct_weekday_for_1752
21+
skip 'Not implemented'
22+
assert_equal 'Monday', ChristmasDay.new(1752).weekday
23+
end
24+
25+
def test_returns_the_correct_weekday_for_1751
26+
skip 'Not implemented'
27+
assert_equal 'Friday', ChristmasDay.new(1751).weekday
28+
end
29+
30+
def test_returns_the_correct_weekday_for_1660
31+
skip 'Not implemented'
32+
assert_equal 'Wednesday', ChristmasDay.new(1660).weekday
33+
end
34+
35+
def test_returns_the_correct_weekday_for_1659
36+
skip 'Not implemented'
37+
assert_raises { ChristmasDay.new(1659).weekday }
38+
end
39+
40+
def test_returns_the_correct_weekday_for_1644
41+
skip 'Not implemented'
42+
assert_raises { ChristmasDay.new(1644).weekday }
43+
end
44+
45+
def test_returns_the_correct_weekday_for_1643
46+
skip 'Not implemented'
47+
assert_equal 'Wednesday', ChristmasDay.new(1643).weekday
48+
end
49+
50+
def test_returns_the_correct_weekday_for_1066
51+
skip 'Not implemented'
52+
assert_equal 'Wednesday', ChristmasDay.new(1066).weekday
53+
end
54+
55+
def test_returns_the_correct_weekday_for_597
56+
skip 'Not implemented'
57+
assert_equal 'Friday', ChristmasDay.new(597).weekday
58+
end
59+
60+
def test_returns_the_correct_weekday_for_596
61+
skip 'Not implemented'
62+
assert_raises { ChristmasDay.new(596).weekday }
63+
end
64+
end

0 commit comments

Comments
 (0)