Add a unit test
This commit is contained in:
19
app_test.rb
Normal file
19
app_test.rb
Normal file
@ -0,0 +1,19 @@
|
||||
ENV['APP_ENV'] = 'test'
|
||||
|
||||
require './app'
|
||||
require 'test/unit'
|
||||
require 'rack/test'
|
||||
|
||||
class ToyTest < Test::Unit::TestCase
|
||||
include Rack::Test::Methods
|
||||
|
||||
def app
|
||||
Sinatra::Application
|
||||
end
|
||||
|
||||
def test_root
|
||||
get '/'
|
||||
assert last_response.ok?
|
||||
assert_equal "hello there!\n", last_response.body
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user