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

lib/popcorn/examples/hello_world/test_example_hello.nit [moved from lib/popcorn/tests/test_example_hello.nit with 73% similarity]
lib/popcorn/examples/hello_world/test_example_hello.sav/test_example_hello.res [moved from lib/popcorn/tests/res/test_example_hello.res with 98% similarity]

 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+module test_example_hello is test_suite
+
+import pop_tests
 import example_hello
-import base_tests
 
-class TestClient
-       super ClientThread
+class TestExampleHello
+       super TestPopcorn
 
-       redef fun main do
+       redef fun client_test do
                system "curl -s {host}:{port}"
                system "curl -s {host}:{port}/"
                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("/", new HelloHandler)
-
-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_hello do
+               var app = new App
+               app.use("/", new HelloHandler)
+               run_test(app)
+       end
+end
@@ -26,4 +26,4 @@
                <body>
                <h1>404 Not Found</h1>
                </body>
-               </html>
\ No newline at end of file
+               </html>