Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use watchr

  • Loading branch information...
commit 92f5a1caa68c47efac8d3b00c8fe107ca0f72352 1 parent fd42c09
@leshill authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 .watchr
View
32 .watchr
@@ -0,0 +1,32 @@
+# vim:set filetype=ruby:
+def run(cmd)
+ puts cmd
+ system cmd
+end
+
+def spec(file)
+ if File.exists?(file)
+ run("rspec #{file}")
+ else
+ puts("Spec: #{file} does not exist.")
+ end
+end
+
+def feature(file)
+ if File.exists?(file)
+ run("cucumber #{file}")
+ else
+ puts("Feature: #{file} does not exist.")
+ end
+end
+
+watch("spec/.*_spec\.rb") do |match|
+ puts(match[0])
+ spec(match[0])
+end
+
+watch("features/.*\.feature") do |match|
+ puts(match[0])
+ feature(match[0])
+end
+
Please sign in to comment.
Something went wrong with that request. Please try again.