Up through using watchr (but why so many child processes?)

This commit is contained in:
Dan Buch 2011-11-14 08:07:28 -05:00
parent 21ce651984
commit 99b84ea0c9
5 changed files with 42 additions and 1 deletions

24
rails/gerbil/.watchr Normal file
View File

@ -0,0 +1,24 @@
def run_spec(file)
unless File.exist?(file)
puts "#{file} does not exist"
return
end
puts "Running #{file}"
system "bundle exec rspec #{file}"
puts
end
watch("spec/[^/]*/[^/]*_spec\\.rb") do |match|
run_spec(match[0])
end
watch("app/(.*)\\.rb") do |match|
run_spec(%{spec/#{match[1]}_spec.rb})
end
# vim:filetype=ruby

View File

@ -34,4 +34,7 @@ gem 'jquery-rails'
group :development, :test do group :development, :test do
gem 'rspec-rails' gem 'rspec-rails'
gem 'watchr'
gem 'rev'
gem 'spork'
end end

View File

@ -44,6 +44,7 @@ GEM
multi_json (~> 1.0) multi_json (~> 1.0)
hike (1.2.1) hike (1.2.1)
i18n (0.6.0) i18n (0.6.0)
iobuffer (1.0.0)
jquery-rails (1.0.17) jquery-rails (1.0.17)
railties (~> 3.0) railties (~> 3.0)
thor (~> 0.14) thor (~> 0.14)
@ -82,6 +83,8 @@ GEM
rake (0.9.2.2) rake (0.9.2.2)
rdoc (3.11) rdoc (3.11)
json (~> 1.4) json (~> 1.4)
rev (0.3.2)
iobuffer (>= 0.1.3)
rspec (2.7.0) rspec (2.7.0)
rspec-core (~> 2.7.0) rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0) rspec-expectations (~> 2.7.0)
@ -116,6 +119,7 @@ GEM
uglifier (1.0.4) uglifier (1.0.4)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (>= 1.0.2) multi_json (>= 1.0.2)
watchr (0.7)
PLATFORMS PLATFORMS
ruby ruby
@ -125,7 +129,9 @@ DEPENDENCIES
jquery-rails jquery-rails
json json
rails (= 3.1.1) rails (= 3.1.1)
rev
rspec-rails rspec-rails
sass-rails (~> 3.1.4) sass-rails (~> 3.1.4)
sqlite3 sqlite3
uglifier (>= 1.0.3) uglifier (>= 1.0.3)
watchr

View File

@ -1,2 +1,3 @@
class Person < ActiveRecord::Base class Person < ActiveRecord::Base
end end

View File

@ -1,5 +1,12 @@
require 'spec_helper' require 'spec_helper'
describe Person do describe Person do
pending "add some examples to (or delete) #{__FILE__}" it "can be instantiated" do
Person.new.should be_an_instance_of(Person)
end
it "can be saved successfully" do
Person.create.should be_persisted
end
end end