quizzes/posix-utilities: Rename from posix-shell.json and flesh out
authorW. Trevor King <wking@tremily.us>
Tue, 5 Feb 2013 19:10:03 +0000 (14:10 -0500)
committerW. Trevor King <wking@tremily.us>
Tue, 5 Feb 2013 19:10:03 +0000 (14:10 -0500)
Added few more questions:
* print the current directory to stdout
* change to your home directory
* change to the parent of your current working directory
* print the contents of README file to the terminal

The renaming is because the tests are testing knowledge of POSIX
utilities, not knowledge of the shell syntax itself.

quizzes/posix-shell.json [deleted file]
quizzes/posix-utilities.json [new file with mode: 0644]

diff --git a/quizzes/posix-shell.json b/quizzes/posix-shell.json
deleted file mode 100644 (file)
index 192958c..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-{
-       "version": "0.1",
-       "questions": [
-               {
-                       "class": "ScriptQuestion",
-                       "interpreter": "sh",
-                       "prompt": "list all the files in the current directory",
-                       "answer": "ls",
-                       "setup": [
-                               "touch file-1 file-2 file-3"
-                               ],
-                       "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html"
-               }
-       ]
-}
diff --git a/quizzes/posix-utilities.json b/quizzes/posix-utilities.json
new file mode 100644 (file)
index 0000000..43c30af
--- /dev/null
@@ -0,0 +1,58 @@
+{
+       "version": "0.1",
+       "questions": [
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "prompt": "list all the files in the current directory",
+                       "answer": "ls",
+                       "setup": [
+                               "touch file-1 file-2 file-3"
+                               ],
+                       "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html"
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "prompt": "print the current directory to stdout",
+                       "answer": "pwd",
+                       "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html"
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "prompt": "change to your home directory",
+                       "answer": "cd",
+                       "teardown": [
+                               "pwd"
+                               ],
+                       "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html"
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "prompt": "change to the parent of your current working directory",
+                       "answer": "cd ..",
+                       "teardown": [
+                               "pwd"
+                               ],
+                       "help": "http://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html",
+                       "dependencies": [
+                               "change to your home directory"
+                               ]
+               },
+               {
+                       "class": "ScriptQuestion",
+                       "interpreter": "sh",
+                       "prompt": "print the contents of README file to the terminal",
+                       "answer": "cat README",
+                       "setup": [
+                               "echo 'This project is wonderful' > README"
+                               ],
+                       "help": "The README file is in your current directory.\nhttp://pubs.opengroup.org/onlinepubs/009696699/idx/utilities.html",
+                       "dependencies": [
+                               "list all the files in the current directory"
+                               ]
+               }
+       ]
+}