Sha256: a020efb727e1120379c3a9318d48e12fd1f52b3e80c023804f6aa8220ae27141

Contents?: true

Size: 625 Bytes

Versions: 17

Compression:

Stored size: 625 Bytes

Contents

# Watchr is the preferred method to run specs automatically over rspactor for
# Mongoid. If you are using vim, you can add the file:
#
# ~/.vim/ftdetect/watchr.vim
#
# This should have only the following line in it:
#
# autocmd BufNewFile,BufRead *.watchr setf ruby
#
# This will enable vim to recognize this file as ruby code should you wish to
# edit it.
def run(cmd)
  puts cmd
  system cmd
end

def spec(file)
  run "spec -O spec/spec.opts #{file}"
end

watch("spec/.*/*_spec\.rb") do |match|
  p match[0]
  spec(match[0])
end

watch('lib/(.*/.*)\.rb') do |match|
  p match[1]
  spec("spec/unit/#{match[1]}_spec.rb")
end

Version data entries

17 entries across 17 versions & 3 rubygems

Version Path
mongoid-1.2.13 .watchr
mongoid-1.2.12 .watchr
mongoid-1.2.11 .watchr
mongoid-1.2.10 .watchr
mongoid-1.2.9 .watchr
mongoid-1.2.8 .watchr
humanoid-1.2.7 .watchr
mongoid-1.2.7 .watchr
mongoid-pre-2.0.0.pre .watchr
mongoid-1.2.6 .watchr
mongoid-1.2.5 .watchr
mongoid-1.2.4 .watchr
mongoid-1.2.3 .watchr
mongoid-1.2.2 .watchr
mongoid-1.2.1 .watchr
mongoid-1.2.0 .watchr
mongoid-1.1.4 .watchr