Skip to content

Commit

Permalink
[+] watchr & rspec config example files
Browse files Browse the repository at this point in the history
  • Loading branch information
nordringrayhide committed May 13, 2011
1 parent 702a050 commit 7d07be1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,6 +1,7 @@
.*
!.gitignore
!.gitmodules
!*.example
*.gem
.bundle
Gemfile.lock
Expand Down
1 change: 1 addition & 0 deletions .rspec.example
@@ -0,0 +1 @@
--color
13 changes: 13 additions & 0 deletions .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") }

0 comments on commit 7d07be1

Please sign in to comment.