server: fakeweb -> webroot

This commit is contained in:
0x1eef 2023-06-27 13:55:12 -03:00
parent 3fddb22b02
commit 63d5206a10
7 changed files with 8 additions and 8 deletions

View file

@ -8,14 +8,14 @@ class ServerDirTest < Test::Unit::TestCase
get "/"
assert_equal 200, last_response.status
assert_equal "text/html", last_response.content_type
assert_equal bytesize("./test/fakeweb/index.html"), last_response.content_length
assert_equal bytesize("./test/webroot/index.html"), last_response.content_length
end
def test_ttf_font
get "/fonts/roboto-mono-regular.ttf"
assert_equal 200, last_response.status
assert_equal "font/ttf", last_response.content_type
assert_equal bytesize("./test/fakeweb/fonts/roboto-mono-regular.ttf"),
assert_equal bytesize("./test/webroot/fonts/roboto-mono-regular.ttf"),
last_response.content_length
end
@ -23,7 +23,7 @@ class ServerDirTest < Test::Unit::TestCase
get "/js/index.js"
assert_equal 200, last_response.status
assert_equal "application/javascript", last_response.content_type
assert_equal bytesize("./test/fakeweb/js/index.js"),
assert_equal bytesize("./test/webroot/js/index.js"),
last_response.content_length
end
@ -31,7 +31,7 @@ class ServerDirTest < Test::Unit::TestCase
get "/images/0x1eef.png"
assert_equal 200, last_response.status
assert_equal "image/png", last_response.content_type
assert_equal bytesize("./test/fakeweb/images/0x1eef.png"),
assert_equal bytesize("./test/webroot/images/0x1eef.png"),
last_response.content_length
end
@ -39,19 +39,19 @@ class ServerDirTest < Test::Unit::TestCase
get "/json/1.json"
assert_equal 200, last_response.status
assert_equal "application/json", last_response.content_type
assert_equal bytesize("./test/fakeweb/json/1.json"),
assert_equal bytesize("./test/webroot/json/1.json"),
last_response.content_length
end
def test_permission_denied
File.chmod 0, "./test/fakeweb/permission_denied.html"
File.chmod 0, "./test/webroot/permission_denied.html"
get "/permission_denied.html"
assert_equal 403, last_response.status
assert_equal "text/plain", last_response.content_type
assert_equal "Permission denied".bytesize, last_response.content_length
assert_equal "Permission denied", last_response.body
ensure
File.chmod 0440, "./test/fakeweb/permission_denied.html"
File.chmod 0440, "./test/webroot/permission_denied.html"
end
def test_page_not_found
@ -65,7 +65,7 @@ class ServerDirTest < Test::Unit::TestCase
private
def app
@app ||= Server.app("./test/fakeweb/")
@app ||= Server.app("./test/webroot/")
end
def bytesize(path)

View file

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB