Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Quick Start Walkthrough
- Create a new Rails app
- Install the Teaspoon Jasmine gem and bootstrap it with the generator (
rails g teaspoon:install)
- Write your first spec (walkthrough below)
- Run the test suite
- Red. green. refactor.
Writing your first spec
The install generator will create a
#= require calculator describe "Calculator", -> it "should add two numbers", -> expect( new Calculator().add(2,2) ).toBe(4)
Now let's create an
rake teaspoon - you should see your first failing spec.
Failures: 1) Calculator should add two numbers. Failure/Error: TypeError: 'undefined' is not a function
To make the test pass we just need to implement the
add: (a, b) -> a + b
rake teaspoon again and that spec should be passing!
If you'd prefer, you can also run your tests in the browser. Fire up your Rails server and visit localhost:3000/teaspoon to run the specs in whichever browser you want.