]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/furnace/sessions/sessions-tests.factor
Delete empty unit tests files, remove 1- and 1+, reorder IN: lines in a lot of places...
[factor.git] / basis / furnace / sessions / sessions-tests.factor
old mode 100755 (executable)
new mode 100644 (file)
index ff089a9..49311ee
@@ -1,11 +1,12 @@
-IN: furnace.sessions.tests\r
 USING: tools.test http furnace.sessions furnace.actions\r
 http.server http.server.responses math namespaces make kernel\r
 accessors io.sockets io.servers.connection prettyprint\r
-io.streams.string io.files splitting destructors sequences db\r
-db.tuples db.sqlite continuations urls math.parser furnace ;\r
+io.streams.string io.files io.files.temp io.directories\r
+splitting destructors sequences db db.tuples db.sqlite\r
+continuations urls math.parser furnace furnace.utilities ;\r
+IN: furnace.sessions.tests\r
 \r
-: with-session\r
+: with-session ( session quot -- )\r
     [\r
         [ [ save-session-after ] [ session set ] bi ] dip call\r
     ] with-destructors ; inline\r
@@ -18,10 +19,10 @@ M: foo init-session* drop 0 "x" sset ;
 \r
 M: foo call-responder*\r
     2drop\r
-    "x" [ 1+ ] schange\r
+    "x" [ 1 + ] schange\r
     "x" sget number>string "text/html" <content> ;\r
 \r
-: url-responder-mock-test\r
+: url-responder-mock-test ( -- string )\r
     [\r
         <request>\r
             "GET" >>method\r
@@ -33,7 +34,7 @@ M: foo call-responder*
         [ write-response-body drop ] with-string-writer\r
     ] with-destructors ;\r
 \r
-: sessions-mock-test\r
+: sessions-mock-test ( -- string )\r
     [\r
         <request>\r
             "GET" >>method\r
@@ -44,15 +45,15 @@ M: foo call-responder*
         [ write-response-body drop ] with-string-writer\r
     ] with-destructors ;\r
 \r
-: <exiting-action>\r
+: <exiting-action> ( -- action )\r
     <action>\r
         [ [ ] "text/plain" <content> exit-with ] >>display ;\r
 \r
-[ "auth-test.db" temp-file sqlite-db delete-file ] ignore-errors\r
+[ "auth-test.db" temp-file delete-file ] ignore-errors\r
 \r
-"auth-test.db" temp-file sqlite-db [\r
+"auth-test.db" temp-file <sqlite-db> [\r
 \r
-    <request> init-request\r
+    <request> "GET" >>method init-request\r
     session ensure-table\r
 \r
     "127.0.0.1" 1234 <inet4> remote-address set\r
@@ -72,7 +73,7 @@ M: foo call-responder*
 \r
         [ 9 ] [ "x" sget sq ] unit-test\r
 \r
-        [ ] [ "x" [ 1- ] schange ] unit-test\r
+        [ ] [ "x" [ 1 - ] schange ] unit-test\r
 \r
         [ 4 ] [ "x" sget sq ] unit-test\r
 \r