Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 30 lines (26 sloc) 0.625 kb
4ac474b Durran Jordan Updating watchr script with come comments
durran authored
1 # Watchr is the preferred method to run specs automatically over rspactor for
2 # Mongoid. If you are using vim, you can add the file:
3 #
4 # ~/.vim/ftdetect/watchr.vim
5 #
6 # This should have only the following line in it:
7 #
8 # autocmd BufNewFile,BufRead *.watchr setf ruby
9 #
10 # This will enable vim to recognize this file as ruby code should you wish to
11 # edit it.
bd36063 Durran Jordan Adding watchr instead of rspactor
durran authored
12 def run(cmd)
13 puts cmd
14 system cmd
15 end
16
17 def spec(file)
18 run "spec -O spec/spec.opts #{file}"
19 end
20
4ac474b Durran Jordan Updating watchr script with come comments
durran authored
21 watch("spec/.*/*_spec\.rb") do |match|
22 p match[0]
23 spec(match[0])
24 end
25
26 watch('lib/(.*/.*)\.rb') do |match|
27 p match[1]
28 spec("spec/unit/#{match[1]}_spec.rb")
29 end
Something went wrong with that request. Please try again.