Giter VIP home page Giter VIP logo

learn_ruby's Introduction

Test First Ruby -- RSpec 3 Edition

This is modified version of test-first.org's learn ruby project. See testfirst.org/learn_ruby for more information about how this will work. These test-first Ruby challenges have been forked from https://github.com/alexch/learn_ruby and updated to use RSpec 3 instead of RSpec 2.

Set up instructions

  1. Fork this repo
  2. Clone your version of the repo to your local machine
  3. On your local machine, cd into the root folder of this repo in your terminal
  4. run bundle install to install all the gems this project needs.

Getting started with the exercises

To work through the first exercise, follow this process

  1. cd into 00_hello from the root folder of this project
  2. Run rake, to run the tests. It will fail with the following error:
Failures:

  1) the hello function says hello
    Failure/Error: expect(hello).to eq("Hello!")

    NameError:
      undefined local variable or method `hello' for #<RSpec::ExampleGroups::TheHelloFunction:0x007fa1221408f0>
      # ./00_hello/hello_spec.rb:106:in `block (2 levels) in <top (required)>'
  1. If the test fails to run and your get a rake aborted! No Rakefile found or any other error message not like the one above ensure that your working directory (pwd to see the path) contains no spaces as this is a common mistake made by people new to Rspec.
  2. Read the failure output carefully and write the code that will make it pass
  3. Run the tests again with rake
  4. This will output that one test has passed and another test failure, write the code to make the next test pass.
  5. Continue this process until all tests pass (when they are green) you have now completed the exercise.
  6. Do this for all the exercises in this project
  7. To get hints and tips about each exercise, view the index.html file that is included in each exercise folder

Basically, this is "error-driven development"... you'll keep running tests, hitting error messages, fixing those messages, running more tests... It is meant to not only test your Ruby skills but also get you comfortable seeing big scary looking stack traces and error messages. Most of the development you do at first will be just like this. In fact, most of all development is error-driven. So get comfortable with it!

Troubleshooting

  • Don't name any of your directories with spaces in them! It will give you horribly frustrating error messages and code hates dealing with spaces. For instance:

    # BAD:
    /Documents/My Homework/ruby
    
    # GOOD:
    /Documents/my_homework/ruby
    

Credit

This is forked from https://github.com/alexch/learn_ruby, its original creator.

learn_ruby's People

Contributors

alexch avatar strychemi avatar eriktrautman avatar kevinmulhern avatar olegsliusar avatar 105ron avatar gunax avatar nchaffee avatar

Watchers

James Cloos avatar  avatar

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.