Up through using watchr (but why so many child processes?)
This commit is contained in:
parent
21ce651984
commit
99b84ea0c9
24
rails/gerbil/.watchr
Normal file
24
rails/gerbil/.watchr
Normal 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
|
@ -34,4 +34,7 @@ gem 'jquery-rails'
|
||||
|
||||
group :development, :test do
|
||||
gem 'rspec-rails'
|
||||
gem 'watchr'
|
||||
gem 'rev'
|
||||
gem 'spork'
|
||||
end
|
||||
|
@ -44,6 +44,7 @@ GEM
|
||||
multi_json (~> 1.0)
|
||||
hike (1.2.1)
|
||||
i18n (0.6.0)
|
||||
iobuffer (1.0.0)
|
||||
jquery-rails (1.0.17)
|
||||
railties (~> 3.0)
|
||||
thor (~> 0.14)
|
||||
@ -82,6 +83,8 @@ GEM
|
||||
rake (0.9.2.2)
|
||||
rdoc (3.11)
|
||||
json (~> 1.4)
|
||||
rev (0.3.2)
|
||||
iobuffer (>= 0.1.3)
|
||||
rspec (2.7.0)
|
||||
rspec-core (~> 2.7.0)
|
||||
rspec-expectations (~> 2.7.0)
|
||||
@ -116,6 +119,7 @@ GEM
|
||||
uglifier (1.0.4)
|
||||
execjs (>= 0.3.0)
|
||||
multi_json (>= 1.0.2)
|
||||
watchr (0.7)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
@ -125,7 +129,9 @@ DEPENDENCIES
|
||||
jquery-rails
|
||||
json
|
||||
rails (= 3.1.1)
|
||||
rev
|
||||
rspec-rails
|
||||
sass-rails (~> 3.1.4)
|
||||
sqlite3
|
||||
uglifier (>= 1.0.3)
|
||||
watchr
|
||||
|
@ -1,2 +1,3 @@
|
||||
class Person < ActiveRecord::Base
|
||||
|
||||
end
|
||||
|
@ -1,5 +1,12 @@
|
||||
require 'spec_helper'
|
||||
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user