Skip to content

Instantly share code, notes, and snippets.

@pingjiang
Created October 11, 2014 06:53
Show Gist options
  • Save pingjiang/a4060fb0971446a276f0 to your computer and use it in GitHub Desktop.
Save pingjiang/a4060fb0971446a276f0 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 extract $rar', function() {"
echo "rar.extract('./test/fixtures/${rar}', './tmp/'); "
echo "var expected = ["
unrar lb $rar | sed -e 's/^/ "/' | sed -e 's/$/", /'
echo "]; "
echo "EXISTS_FILES(expected); "
echo "});"
echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment