Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add pretest

  • Loading branch information...
commit 5af14f65cd5a4341ee985e02bc9f76fc2fbcff4f 1 parent 05d544a
@josh authored
Showing with 13 additions and 1 deletion.
  1. +9 −0 Cakefile
  2. +4 −1 package.json
View
9 Cakefile
@@ -7,6 +7,15 @@ task 'build', "Build CoffeeScript source files", ->
coffee = spawn 'coffee', ['-cw', '-o', 'lib', 'src']
coffee.stdout.on 'data', (data) -> process.stderr.write data.toString()
+task 'pretest', "Install test dependencies", ->
+ exec 'which ruby gem', (err) ->
+ throw "ruby not found" if err
+
+ exec 'ruby -rubygems -e \'require "rack"\'', (err) ->
+ if err
+ exec 'gem install rack', (err, stdout, stderr) ->
+ throw err if err
+
task 'test', "Run test suite", ->
process.chdir __dirname
{reporters} = require 'nodeunit'
View
5 package.json
@@ -23,5 +23,8 @@
, "nodeunit" : ">= 0.5.0"
}
, "engines": { "node" : ">=0.4.0" }
-, "scripts": { "test": "cake test" }
+, "scripts":
+ { "pretest": "cake pretest"
+ , "test": "cake test"
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.