Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[+] watchr & rspec config example files

  • Loading branch information...
commit 7d07be18b61b9db92d7bc68778dfd0ff8f1b48fd 1 parent 702a050
@romanvbabenko romanvbabenko authored
Showing with 15 additions and 0 deletions.
  1. +1 −0  .gitignore
  2. +1 −0  .rspec.example
  3. +13 −0 .watchr.example
View
1  .gitignore
@@ -1,6 +1,7 @@
.*
!.gitignore
!.gitmodules
+!*.example
*.gem
.bundle
Gemfile.lock
View
1  .rspec.example
@@ -0,0 +1 @@
+--color
View
13 .watchr.example
@@ -0,0 +1,13 @@
+ROOT_PATH = File.dirname(__FILE__)
+
+def run_spec(file)
+ system "rspec #{file}" if File.exist?(File.join(ROOT_PATH, file))
+end
+
+watch('spec/.*_spec\.rb') {|m| run_spec m[0] }
+watch('spec/notes/.*_spec\.rb') {|m| run_spec m[0] }
+
+watch('lib/rails-footnotes/(.*)\.rb') {|m| run_spec("spec/#{m[1]}_spec.rb") }
+watch('lib/rails-footnotes/notes/.*_note\.rb') {|m| run_spec("spec/notes/#{m[1]}") }
+
+watch('Gemfile') {|m| run_spec("spec") }
Please sign in to comment.
Something went wrong with that request. Please try again.