Created
June 24, 2009 17:07
-
-
Save kematzy/135388 to your computer and use it in GitHub Desktop.
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 'rubygems' | |
require 'spec' | |
require 'spec/interop/test' | |
# require 'test/spec' | |
require 'sinatra/base' | |
require 'rack/test' | |
class Dummy < Sinatra::Base | |
set :public, 'public' | |
set :views, 'views' | |
get '/' do | |
"hello world" | |
end | |
end | |
class Test::Unit::TestCase | |
include Rack::Test::Methods | |
def app | |
Dummy.new | |
end | |
### NB!!! ############ | |
# Commenting / Uncommenting this method will show the error | |
# | |
# def setup | |
# Sinatra::Base.set :environment, :test | |
# end | |
end | |
describe "Dummy" do | |
it "should return hello world from the / (this works in both cases)" do | |
get '/' | |
assert_equal('hello world', last_response.body) | |
end | |
it "should NOT return a Sinatra::ShowExceptions object" do | |
assert_no_match(/Sinatra::ShowExceptions/, app.inspect ) | |
end | |
it "should be a Dummy class" do | |
assert_equal(Dummy, app.class ) | |
end | |
end #/ Dummy | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment