Coder Social home page Coder Social logo

codelab-sinatra-tdd-helper-methods's Introduction

Helper Methods Practice

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?

How to work on this

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.

codelab-sinatra-tdd-helper-methods's People

Contributors

chrisvfritz avatar

Watchers

 avatar  avatar  avatar

codelab-sinatra-tdd-helper-methods's Issues

Add 'io-console' gem to Gemfile

guard requires the gem io-console through thor. Without it, this happens:

[12:15 ~/tc359/p8] % bundle exec guard
/home/ec2-user/.gem/ruby/2.0/gems/thor-0.19.1/lib/thor/shell/basic.rb:2:in `require': cannot load such file -- io/console (LoadError)
        from /home/ec2-user/.gem/ruby/2.0/gems/thor-0.19.1/lib/thor/shell/basic.rb:2:in `<top (required)>'
        from /home/ec2-user/.gem/ruby/2.0/gems/thor-0.19.1/lib/thor/shell/color.rb:1:in `require'
        from /home/ec2-user/.gem/ruby/2.0/gems/thor-0.19.1/lib/thor/shell/color.rb:1:in `<top (required)>'
        from /home/ec2-user/.gem/ruby/2.0/gems/thor-0.19.1/lib/thor/shell.rb:17:in `shell'
        from /home/ec2-user/.gem/ruby/2.0/gems/thor-0.19.1/lib/thor/base.rb:439:in `start'
        from /home/ec2-user/.gem/ruby/2.0/gems/guard-2.12.1/lib/guard/aruba_adapter.rb:32:in `execute'
        from /home/ec2-user/.gem/ruby/2.0/gems/guard-2.12.1/lib/guard/aruba_adapter.rb:19:in `execute!'
        from /home/ec2-user/.gem/ruby/2.0/gems/guard-2.12.1/bin/_guard-core:11:in `<main>'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.