This week we take another step towards Test-Driven Development. Similar to how you were asked to make changes the Structs and OpenStructs to make the tests pass. Here again your job is to define the functionality of the methods that are described in the test suite.
- Fork and clone this repository
- Fix the tests on a branch
- Push your changes to Github on that branch
The exercise are laid out in the same way as before, however there are still some subtle differences so I implore you to read the following closely.
- Fork and clone this repository
- Run Bundler
- Run the tests / Setup Guard
- Switch to the 'solutions' branch
- Write the methods required to make the examples pass in each of the associated files in the lib directory.
- Commit your changes to the 'solutions' branch
- Push your 'solutions' branch up to Github
Usually working on the master branch is acceptable behavior. However, there is a common workflow pattern to create a branch and to put work on that branch. Branching in git is easy.
Before you commit any changes that solve this week's exercise I want you to create a solutions
branch.
$ git branch solutions
$ git checkout solutions
Write the methods required to make the examples pass in each of the associated files in the lib directory
A difference from last week, is that you should define the methods in the lib
folder in the file that matches the name of spec folder. This is so the implementation of your methods are independent of test files.
That means you will will be writing code that fixes the find_quote_spec.rb
in lib/find_quote.rb
. Fix the display_superheroes_spec.rb
in display_superheroes.rb
...
When you created and switched to the solutions
branch all work that you add and commit will automatically be added to the solutions
branch.
When you are ready to push your solutions to Github you will specify your new branch name.
$ git push origin solutions
This is nearly identical to the command you ran previously the exception being the word master
is now replaced with 'solutions`.