Created
February 12, 2012 23:21
-
-
Save mneedham/1811716 to your computer and use it in GitHub Desktop.
hello_world_spec.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rspec' | |
| require 'rack/test' | |
| require 'hello_world' | |
| require 'repository' | |
| describe 'Hello World application' do | |
| include Rack::Test::Methods | |
| def app | |
| HelloWorld | |
| end | |
| it 'should return Hello, world at root URL' do | |
| mock_repo = mock('repository') | |
| mock_repo.stub(:get).with('foo').and_return('bar') | |
| Repository.stub(:new).and_return(mock_repo) | |
| get '/' | |
| last_response.body.should == 'bar' | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment