Skip to content

Instantly share code, notes, and snippets.

@fsvehla
Created February 22, 2011 10:51
Show Gist options
  • Save fsvehla/838499 to your computer and use it in GitHub Desktop.
Save fsvehla/838499 to your computer and use it in GitHub Desktop.
1 def nodeunit(*files)
2 system "bin/nodeunit #{ files.join(' ') }"
3 end
4
5 watch("test/unit/.*") do |match|
6 nodeunit match[0]
7 end
8
9 # Run unit tests by default
10
11 watch("lib/kitz/.*/.*") do |match|
12 nodeunit "test/unit/*_test.js"
13 end
14
15 # The last rule that matches wins - we can refine behaviour here to run only
16 # a part of the specs
17
18 watch("lib/kitz/(memcache/memcache.js|frontends/memcache.js)") do |match|
19 nodeunit "test/unit/memcache_test.js"
20 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment