This workshop is based on Sandi Metz 99 Bottles of OOP book
- Learn more here
-
Install Homebrew
Verify whether you have Homebrew installed, run the following command in your terminalwhich brew
If nothing is returned, you'll need to install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-
Install Git
Verify whether you have Git installed, run the following command in your terminalwhich git
If nothing is returned, you'll need to install Git
brew install git
-
Install Bundler Verify whether you have bundler installed, run the following command in your terminal
which bundler
If nothing is returned, you'll need to install bundler
sudo gem install bundler
-
Clone the tdd_workshop project into your desired project folder
-
git clone [email protected]:teresamychu/tdd_workshop.git
-
Navigate to the
notes
directory and run the following commandsbundle install
bundle exec guard
-
Once guard is running:
- You can press Enter to run all tests AND
- Guard should run all tests whenever you save changes in the project (sometimes it doesnt work) .
-
You are ready to start the workshop!
- The goal of this exercise is to take a working solution and refactor it until there is as little repetition as possible.
- Here are the steps of the workshop:
- Run guard (Guard should be running at all times during the exercise)
- See above for instructions.
- Open the
bottles.rb
file:- Choose two chunks of the code that are the most similar.
- Refactor the code to remove the smallest difference between these two chunks.
- If your changes cause tests to fail, undo the changes until the tests are passing again and retry.
- Repeat with the next part of the code that is the most similar.
- Continue until there is the least amount of repetition in your solution.
- Run guard (Guard should be running at all times during the exercise)