/advent-rb

Doing "Advent of Code" exercises in Ruby with all the proper testing

Primary LanguageRuby

advent-rb

Test code

Consistency is hard without proper goals to set a good (let's dare say "atomic") habit, so I'm writing solutions for Advent of Code in Ruby with all the proper required testing.

I'm also adding notes that may be useful if you're learning Ruby.

Notes for solving:

How to use

Install dependencies with bundle install. If you are in a hurry, just install RSpec with gem install rspec and run rspec in the root directory.

Regarding RuboCop rules

I use my own set of rules, which I try to keep as close as possible to the official style, but some style rules just don't make sense to me, and RuboCop's default rules are here to enforce a single style.

However, consistency for the sake of consistency is widely agreed to be plain dumb, so I reserve myself the right to disable rules as I require, for the sake of easier code reading.

Testing guidelines

The tests are written with Test-driven Development principles by using the input and results provided by each exercise's samples. The full input is then used in the tests, and the expected results are validated on the website.

A GitHub Action is available to test the code as soon as it is pushed.