From cf2a3a56f18c12d9887086db7fa2c62689bd44ed Mon Sep 17 00:00:00 2001 From: Alexandre Terrasa Date: Thu, 2 Jun 2016 11:17:17 -0400 Subject: [PATCH] popcorn: test test_example_simple_error_handler with pop_tests Signed-off-by: Alexandre Terrasa --- .../test_example_simple_error_handler.nit | 36 +++++++------------- .../test_example_simple_error_handler.res | 0 2 files changed, 13 insertions(+), 23 deletions(-) rename lib/popcorn/{tests => examples/middlewares}/test_example_simple_error_handler.nit (68%) rename lib/popcorn/{tests/res => examples/middlewares/test_example_simple_error_handler.sav}/test_example_simple_error_handler.res (100%) diff --git a/lib/popcorn/tests/test_example_simple_error_handler.nit b/lib/popcorn/examples/middlewares/test_example_simple_error_handler.nit similarity index 68% rename from lib/popcorn/tests/test_example_simple_error_handler.nit rename to lib/popcorn/examples/middlewares/test_example_simple_error_handler.nit index ce671f0..1b1f080 100644 --- a/lib/popcorn/tests/test_example_simple_error_handler.nit +++ b/lib/popcorn/examples/middlewares/test_example_simple_error_handler.nit @@ -14,33 +14,23 @@ # See the License for the specific language governing permissions and # limitations under the License. +module test_example_simple_error_handler is test_suite + +import pop_tests import example_simple_error_handler -import base_tests -class TestClient - super ClientThread +class TestExampleSimpleErrorHandler + super TestPopcorn - redef fun main do + redef fun client_test do system "curl -s {host}:{port}/" system "curl -s {host}:{port}/about" - return null end -end - -var app = new App -app.use("/", new HelloHandler) -app.use("/*", new SimpleErrorHandler) - -var host = test_host -var port = test_port -var server = new AppThread(host, port, app) -server.start -0.1.sleep - -var client = new TestClient(host, port) -client.start -client.join -0.1.sleep - -exit 0 + fun test_example_param_route do + var app = new App + app.use("/", new HelloHandler) + app.use("/*", new SimpleErrorHandler) + run_test(app) + end +end diff --git a/lib/popcorn/tests/res/test_example_simple_error_handler.res b/lib/popcorn/examples/middlewares/test_example_simple_error_handler.sav/test_example_simple_error_handler.res similarity index 100% rename from lib/popcorn/tests/res/test_example_simple_error_handler.res rename to lib/popcorn/examples/middlewares/test_example_simple_error_handler.sav/test_example_simple_error_handler.res -- 1.7.9.5