guard (rspec) not detecting changes

393 views
Skip to first unread message

richardjortega

unread,
May 16, 2012, 12:44:53 AM5/16/12
to guard-dev
I don't know where to post this but everytime I update my tests, guard-
rspec isn't rerunning the test suite. I know this isn't a guard-rspec
forum, but I'm wondering if anyone might know an answer. here is my
information. It runs the suite when the command is first run but
doesn't automatically run when files change, like it's not watching
the folders.

I've included the verbose terimnal output, my guardfile, and my
gemfile.

Richards-iMac:sample_app2 iMac$ bundle exec guard --verbose
Guard uses GNTP to send notifications.
Guard is now watching at '/Users/iMac/Dropbox/code/sample_app2'
DEBUG (23:38:50): Hook :start_begin executed for Guard::Spork
DEBUG (23:38:50): Command execution: ps aux | awk '/spork/&&!/awk/
{print $2;}'
DEBUG (23:38:50): Killing Spork servers with PID:
DEBUG (23:38:50): Command execution: ps aux | awk '/spork/&&!/awk/
{print $2;}'
Starting Spork for RSpec & Cucumber
DEBUG (23:38:50): Spawned Spork server 7581 ('bundle exec spork -p
8989')
DEBUG (23:38:50): Command execution: ps aux | awk '/spork/&&!/awk/
{print $2;}'
DEBUG (23:38:50): Spawned Spork server 7585 ('bundle exec spork cu -p
8990')
Using Cucumber
Using RSpec
Preloading Rails environment
/Users/iMac/Dropbox/code/sample_app2/features/support/env.rb has not
been bootstrapped. Run spork --bootstrap to do so.
Loading Spork.prefork block...
Preloading Rails environment
Spork is ready and listening on 8990!
Spork is ready and listening on 8989!
Spork server for RSpec & Cucumber successfully started
DEBUG (23:38:56): Hook :start_end executed for Guard::Spork
DEBUG (23:38:56): Hook :start_begin executed for Guard::RSpec
Guard::RSpec is running, with RSpec 2!
Running all specs
DEBUG (23:38:56): Command execution: bundle exec rspec --help
DEBUG (23:38:58): Command execution: bundle exec rspec -f progress -r /
Users/iMac/.rvm/gems/ruby-1.9.3-p125/gems/guard-rspec-0.7.2/lib/guard/
rspec/formatters/notification_rspec.rb -f
Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-
exit-code 2 spec
Running tests with args ["--color", "--failure-exit-code", "2", "--
format", "progress", "--format",
"Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--
require", "/Users/iMac/.rvm/gems/ruby-1.9.3-p125/gems/guard-
rspec-0.7.2/lib/guard/rspec/formatters/notification_rspec.rb",
"spec"]...
........................................................................FF

Failures:

1) User pages index
Failure/Error: visit users_path
ActionView::MissingTemplate:
Missing template users/index, applicat.....(rest of pass/fail
continue correctly first time)...

---GEMFILE---

source 'https://rubygems.org'

gem 'rails', '3.2.1'
gem 'bootstrap-sass', '2.0.0'
gem 'bcrypt-ruby', '3.0.1'

group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails'
gem 'guard-rspec'
gem 'annotate', '~> 2.4.1.beta'
gem 'capybara', '1.1.2'
gem 'rspec-rails'
gem 'rb-fsevent', :require => false
gem 'growl'
gem 'ruby_gntp'
gem 'guard-spork'
#gem 'spork'
gem 'factory_girl_rails', '1.4.0'
gem 'cucumber-rails', '1.2.1'
gem 'database_cleaner', '0.7.0'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '3.2.3'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.0.3'
end

gem 'jquery-rails', '2.0.0'


group :production do
gem 'pg'
end

---GUARDFILE----
# A sample Guardfile
# More info at https://github.com/guard/guard#readme

guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env
=> { 'RAILS_ENV' => 'test' } do
watch('config/application.rb')
watch('config/environment.rb')
watch(%r{^config/environments/.+\.rb$})
watch(%r{^config/initializers/.+\.rb$})
watch('Gemfile')
watch('Gemfile.lock')
watch('spec/spec_helper.rb')
watch('test/test_helper.rb')
end


guard 'rspec', :version => 2 do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }

# Rails example
watch(%r{^app/(.+)\.rb$}) { |m| "spec/
#{m[1]}_spec.rb" }
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/
#{m[1]}#{m[2]}_spec.rb" }
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/
routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}
_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
watch('config/routes.rb') { "spec/
routing" }
watch('app/controllers/application_controller.rb') { "spec/
controllers" }
# Capybara request specs
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/
requests/#{m[1]}_spec.rb" }
end



Michael Kessler

unread,
May 16, 2012, 3:15:35 AM5/16/12
to guar...@googlegroups.com
The problem is that your project is within Dropbox, see
https://github.com/guard/listen/issues/3 for discussion.
I suggest to first download and install the latest Dropbox
version (1.4.3) and try again. If the problem still persist,
then you could force Guard to use polling by making sure you
don't have `rb-fsevent` in your Gemfile and run Guard with the
`--no-vendor` option.

A last option is to use the current Guard 1.1.0.alpha.2, which
would switch automatically the adapter if Dropbox blocks FSEvents.
But as the gem name suggests, this is more meant as a developer
preview and may be a bit buggy.

richardjortega

unread,
May 16, 2012, 4:28:38 PM5/16/12
to guard-dev
You sir! Are a gentleman and a scholar! It was the Dropbox issue.
First off, I didn't even think about Dropbox updating (it never
updated itself ever like the website says).

However, forcing polling does work by turning of rb-fsevent and
throwing the '--no-vendor' option. It now watches and runs my tests! I
was pulling my hair out trying to figure this out! I'll wait for a
stable release of Guard to come out that has the dropbox detection.

Is there anyway to force that option inside of the guardfile when it
starts running, like adding '--no-vendor' option somewhere? Again,
sorry about my newbie questions!

Richard

On May 16, 2:15 am, Michael Kessler <mi...@netzpiraten.ch> wrote:
> The problem is that your project is within Dropbox, seehttps://github.com/guard/listen/issues/3for discussion.
> > # More info athttps://github.com/guard/guard#readme

Michael Kessler

unread,
May 17, 2012, 5:33:50 AM5/17/12
to guar...@googlegroups.com
Richard,

> You sir! Are a gentleman and a scholar! It was the Dropbox issue.
> First off, I didn't even think about Dropbox updating (it never
> updated itself ever like the website says).

I'm glad I could help. I really do not understand that Dropbox isn't
doing automated updates, I mean, they probably still have to handle
all client versions ever released!

> However, forcing polling does work by turning of rb-fsevent and
> throwing the '--no-vendor' option. It now watches and runs my tests! I
> was pulling my hair out trying to figure this out! I'll wait for a
> stable release of Guard to come out that has the dropbox detection.

I guess that Guard 1.1 will be released at EuRuKo on 1th or 2nd of June.

> Is there anyway to force that option inside of the guardfile when it
> starts running, like adding '--no-vendor' option somewhere? Again,
> sorry about my newbie questions!

There's currently no way the add the `--no-vendor` option anywhere, but
this is something that bugs me too. We may discuss this at the EuRuKo
hackday and come up with a solution.

Michael
Reply all
Reply to author
Forward
0 new messages