According to the preject description, watchr is:
Agile development tool that monitors a directory tree, and triggers a user defined action whenever an observed file is modified. Its most typical use is continuous testing, and as such it is a more flexible alternative to autotest.
But moreover, Watchr can be used on every simple task that need to execute a file, like markdown generate, coffee script compile, and the syntax is so simple to add those task in watchr script.
The syntax is like:
watch 'regular expression' { |matched_file| action_for matched_file } #listen to all file and print filename when it modified watch('.*') {|match| puts match[1]} #listen to ruby file and run test watch('lib/(.*)\.rb') {|match| system("ruby test/test_#{match[1]}.rb") } #match[0] is full filename, match[1] is filename without extname.
running under command:
watchr script_name
Continous Testing
Continous Testing is a concept born from MIT Program Analysis Group,
It improve the Test Driven Development, which is auto run the corresponding test
in TDD right after the code saved. In this way, the test time lag will be reduced to zero,
and programer won't need to run the test to know the program is work or not. Makes testing become natural behavior in development.
Refers
ihower's rails3 watchr script template
Doc generate template from watchr project itself (dog fooding)
Thanks of your posting, which made me to join Testing tools online training @ www.Monstercourses.com
ReplyDelete