mirror of https://github.com/dirtbags/moth.git
Still trying to reproduce #154
This commit is contained in:
parent
8bc5dfd784
commit
782a8f759b
|
@ -174,6 +174,14 @@ func TestFilesystem(t *testing.T) {
|
|||
BaseFs: afero.NewOsFs(),
|
||||
}
|
||||
|
||||
stdout.Reset()
|
||||
if err := tp.Run("puzzle", "-dir=testdata/cat1/1"); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if !strings.Contains(stdout.String(), "moo") {
|
||||
t.Error("File not pulled from cwd", stdout.String())
|
||||
}
|
||||
|
||||
stdout.Reset()
|
||||
if err := tp.Run("file", "-dir=testdata/cat1/1", "-file=moo.txt"); err != nil {
|
||||
t.Error(err)
|
||||
|
@ -181,5 +189,4 @@ func TestFilesystem(t *testing.T) {
|
|||
if !strings.Contains(stdout.String(), "Moo.") {
|
||||
t.Error("Wrong file pulled", stdout.String())
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
moo
|
|
@ -7,9 +7,10 @@ fail () {
|
|||
|
||||
case $1:$2 in
|
||||
puzzle:)
|
||||
cat <<'EOT'
|
||||
read answer < answer.txt
|
||||
cat <<EOT
|
||||
{
|
||||
"Answers": ["answer"],
|
||||
"Answers": ["$answer"],
|
||||
"Pre": {
|
||||
"Authors": ["neale"],
|
||||
"Body": "I am a generated puzzle."
|
||||
|
|
Loading…
Reference in New Issue