2024-07-07 21:26:38 +00:00
|
|
|
ENV["APP_ENV"] = "test"
|
2024-07-06 21:06:53 +00:00
|
|
|
|
2024-07-07 21:26:38 +00:00
|
|
|
require "./app"
|
|
|
|
require "test/unit"
|
|
|
|
require "rack/test"
|
2024-07-06 21:06:53 +00:00
|
|
|
|
|
|
|
class ToyTest < Test::Unit::TestCase
|
|
|
|
include Rack::Test::Methods
|
|
|
|
|
|
|
|
def app
|
|
|
|
Sinatra::Application
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_root
|
2024-07-07 21:26:38 +00:00
|
|
|
get "/"
|
2024-07-06 21:06:53 +00:00
|
|
|
assert last_response.ok?
|
|
|
|
assert_equal "hello there!\n", last_response.body
|
|
|
|
end
|
|
|
|
end
|