Skip to content

Instantly share code, notes, and snippets.

@pingjiang
Created October 11, 2014 04:55
Show Gist options
  • Save pingjiang/c6eecfd1b033550b09a0 to your computer and use it in GitHub Desktop.
Save pingjiang/c6eecfd1b033550b09a0 to your computer and use it in GitHub Desktop.
generate mocha testcase
#!/bin/sh
F=fixtures.md
for rar in `ls *.rar`
do
echo "it('test $rar', function() {"
echo "var entries = rar.list('./test/fixtures/${rar}'); "
echo "var expected = ["
unrar lb $rar | sed -e 's/^/ "/' | sed -e 's/$/", /'
echo "]; "
echo "// assert.deepEqual(entries, expected);"
echo "console.log(entries); "
echo "});"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment