diff --git a/packages/ruby/server/test/fakeweb/js/index.js b/packages/ruby/server/test/fakeweb/js/index.js new file mode 100644 index 0000000..b54d243 --- /dev/null +++ b/packages/ruby/server/test/fakeweb/js/index.js @@ -0,0 +1,3 @@ +(function() { + console.log("Hello world"); +})(); diff --git a/packages/ruby/server/test/server_dir_test.rb b/packages/ruby/server/test/server_dir_test.rb index 8ed8855..dda155c 100644 --- a/packages/ruby/server/test/server_dir_test.rb +++ b/packages/ruby/server/test/server_dir_test.rb @@ -19,6 +19,14 @@ class ServerDirTest < Test::Unit::TestCase last_response.content_length end + def test_js_file + 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"), + last_response.content_length + end + def test_permission_denied File.chmod 0, "./test/fakeweb/permission_denied.html" get "/permission_denied.html"