Skip to content

Instantly share code, notes, and snippets.

@joho
Created July 7, 2009 02:09
Show Gist options
  • Select an option

  • Save joho/141841 to your computer and use it in GitHub Desktop.

Select an option

Save joho/141841 to your computer and use it in GitHub Desktop.
require File.dirname(__FILE__) + '/../spec_helper'
def app
ActionController::Dispatcher.new
end
describe "the homepage" do
include Rack::Test::Methods
it "shouldn't crap out" do
get '/'
last_response.should be_ok
end
end
1 example, 1 failure
Finished in 0.680533 seconds
the homepage
shouldn't crap out
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.downcase
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:27 :in `replaces?'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:127 :in `<<'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:126 :in `reject!'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:126 :in `<<'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:121 :in `merge'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:119 :in `each'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test/cookie_jar.rb:119 :in `merge'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/mock_session.rb:31 :in `request'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test.rb:182 :in `process_request'
/Users/joho/.gem/ruby/1.8/gems/rack-test-0.4.0/lib/rack/test.rb:47 :in `get'
/Users/joho/source/envato/marketplace/spec/rack/homepage_spec.rb:11
/tmp/textmate-command-2419.rb:3
25
26 def replaces?(other)
27 [name.downcase, domain, path] == [other.name.downcase, other.domain, other.path]
28 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment