Commit 8ee0947b authored by Jakob Moser's avatar Jakob Moser
Browse files

Add verification logic using the new verify() function

parent 2770ceef
Loading
Loading
Loading
Loading
+28 −4
Original line number Diff line number Diff line
@@ -20,7 +20,17 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Auch versteckte Dateien anzeigen", async function () {
        this.describe(`Lass dir anzeigen, welche Dateien sich in diesem Verzeichnis befinden (inklusive versteckter Dateien).`)

        // TODO Add verification logic
        await this.manualConfirmation()

        this.verify().hasOutput((outputLines) => {
            for(const line of outputLines) {
                if(line.match(/.*\.ash_history.*/)) {
                    return true
                }
            }
            
            return false
        })
    })

    this.exercise("Verzeichnis anlegen", async function () {
@@ -34,7 +44,9 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Aktuelles Verzeichnis anzeigen", async function () {
        this.describe("Lass dir anzeigen, in welchem Verzeichnis du gerade arbeitest.")

        // TODO Add verification logic
        await this.manualConfirmation()

        this.verify().hasOutput("/root")
    })

    this.exercise("Verzeichnis wechseln", async function() {
@@ -71,7 +83,9 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Inhalt anzeigen", async function () {
        this.describe(`Zeige den Inhalt der Datei "saetze" auf der Konsole an.`)

        // TODO Add verification logic
        await this.manualConfirmation()

        this.verify().hasOutput(["Colorless green ideas sleep furiously.", "The cat is on the mat."])
    })

    this.exercise("Berechtigungen ändern", async function () {
@@ -87,7 +101,17 @@ export const practice = test("Linux-Übungsmodus", function() {
    this.exercise("Berechtigungen anzeigen", async function () {
        this.describe(`Lass dir die aktuellen Berechtigungen für die Datei "saetze" anzeigen.`)

        // TODO Add verification logic
        await this.manualConfirmation()

        this.verify().hasOutput((outputLines) => {
            for(const line of outputLines) {
                if(line.match(/.*-r--rw----.*/)) {
                    return true
                }
            }
            
            return false
        })
    })

    this.exercise("Datei löschen", async function () {