popcorn: test examples/routing/glob_route with pop_tests
authorAlexandre Terrasa <alexandre@moz-code.org>
Thu, 2 Jun 2016 05:43:50 +0000 (01:43 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Thu, 2 Jun 2016 16:03:21 +0000 (12:03 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

lib/popcorn/examples/routing/test_example_glob_route.nit [moved from lib/popcorn/tests/test_example_glob_route.nit with 75% similarity]
lib/popcorn/examples/routing/test_example_glob_route.sav/test_example_glob_route.res [moved from lib/popcorn/tests/res/test_example_glob_route.res with 98% similarity]

 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+module test_example_glob_route is test_suite
+
+import pop_tests
 import example_glob_route
-import base_tests
 
-class TestClient
-       super ClientThread
+class TestExampleGlobRoute
+       super TestPopcorn
 
-       redef fun main do
+       redef fun client_test do
                system "curl -s {host}:{port}/user/Morriar/item/10"
                system "curl -s {host}:{port}/user/Morriar/item/10/"
                system "curl -s {host}:{port}/user/Morriar/item/10/profile"
                system "curl -s {host}:{port}/user/Morriar/item/10/profile/settings"
-
                system "curl -s {host}:{port}/"
                system "curl -s {host}:{port}/not_found"
                system "curl -s {host}:{port}/not_found/not_found"
-               return null
        end
-end
-
-var app = new App
-app.use("/user/:user/item/:item/*", new UserItem)
-
-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_glob_route do
+               var app = new App
+               app.use("/user/:user/item/:item/*", new UserItem)
+               run_test(app)
+       end
+end
@@ -39,4 +39,4 @@ Here the item 10 of the use Morriar.
                <body>
                <h1>404 Not Found</h1>
                </body>
-               </html>
\ No newline at end of file
+               </html>