Add a unit test

This commit is contained in:
2024-07-06 16:06:53 -05:00
parent 5aeb90a18d
commit 68e91f3afb
4 changed files with 44 additions and 0 deletions

19
app_test.rb Normal file
View 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