This is a simple app to help students practice writing helper methods. The front-end is done. The specs are written. It's now up to our server-side web developer to fill out the logic for the application in the 3 helper methods of our MethodsPracticeHelper
module.
Just one file. Yet the very fate of our app depends on it. Are you up to the task?
First, complete the usual first steps of the project to create and then download the repo folder. Then we'll cd
into that folder and make sure the project's dependencies are installed.
bundle install
And finally, we'll run guard, which is set up to watch our methods_practice_helpers.rb file and re-run our specs whenever we save a change.
bundle exec guard
If you're on Windows, guard unfortunately doesn't work very well, so you'll have to just run
bundle exec rspec
each time you want to run your specs.
Now start with one of the specs in spec/helpers/methods_practice_helpers
. When you start working on a method, remove the , :pending
from the describe
line with your method's name. For example, in spec/helpers/methods_practice/image_tag_spec.rb
, we would change this line:
describe '#image_tag', :pending do
to:
describe '#image_tag' do
Note that I removed not only the word :pending
, but also the comma (,
) right before it.
As we make progress and keep saving, the results in the terminal should make their way from scary red to comforting green. When all our specs are green, that means everything should be working as it should. At the end, we can run our app with bundle exec rackup
to confirm that everything on the front-end does indeed look great.
If you're on Windows and do not see any colors, you may be able to fix this with these instructions.