Git Product home page Git Product logo

guard-rspec's Introduction

Guard::RSpec

Gem Version Build Status Dependency Status Code Climate Coverage Status

Guard::RSpec allows to automatically & intelligently launch specs when files are modified.

  • Compatible with RSpec >2.99 & 3
  • Tested against Ruby 2.2.x, JRuby 9.0.5.0 and Rubinius.

Install

Add the gem to your Gemfile (inside development group):

 gem 'guard-rspec', require: false

Add guard definition to your Guardfile by running this command:

$ bundle exec guard init rspec

Installing with beta versions of RSpec

To install beta versions of RSpec, you need to set versions of all the dependencies, e.g:

gem 'rspec', '= 3.5.0.beta3'
gem 'rspec-core', '= 3.5.0.beta3'
gem 'rspec-expectations', '= 3.5.0.beta3'
gem 'rspec-mocks', '= 3.5.0.beta3'
gem 'rspec-support', '= 3.5.0.beta3'

gem 'guard-rspec', '~> 4.7'

and for Rails projects this also means adding:

gem 'rspec-rails', '= 3.5.0.beta3'

and then running bundle update rspec rspec-core rspec-expectations rspec-mocks rspec-support rspec-rails or just bundle update to update all the gems in your project.

Usage

Please read Guard usage doc.

Guardfile

Guard::RSpec can be adapted to all kinds of projects, some examples:

Standard RubyGem project

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

Typical Rails app

guard :rspec, cmd: 'bundle exec rspec' do
  watch('spec/spec_helper.rb')                        { "spec" }
  watch('config/routes.rb')                           { "spec/routing" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  watch(%r{^spec/.+_spec\.rb$})
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$})          { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_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"] }
end

Please read Guard doc for more information about the Guardfile DSL.

Options

Guard::RSpec 4.0 now uses a simpler approach with the new cmd option that let you precisely define which rspec command will be launched on each run. This option is required due to the number of different ways possible to invoke rspec, the template now includes a default that should work for most applications but may not be optimal for all. As example if you want to support Spring with a custom formatter (progress by default) use:

guard :rspec, cmd: 'spring rspec -f doc' do
  # ...
end

NOTE: the above example assumes you have the spring rspec command installed - see here: https://github.com/jonleighton/spring-commands-rspec

Running with bundler

Running bundle exec guard will not run the specs with bundler. You need to change the cmd option to bundle exec rspec:

guard :rspec, cmd: 'bundle exec rspec' do
  # ...
end

List of available options:

cmd: 'zeus rspec'      # Specify a custom rspec command to run, default: 'rspec'
cmd_additional_args: '-f progress' # Any arguments that should be added after the default
                                   # arguments are applied but before the spec list
spec_paths: ['spec']   # Specify a custom array of paths that contain spec files
failed_mode: :focus    # What to do with failed specs
                       # Available values:
                       #  :focus - focus on the first 10 failed specs, rerun till they pass
                       #  :keep - keep failed specs until they pass (add them to new ones)
                       #  :none (default) - just report
all_after_pass: true   # Run all specs after changed specs pass, default: false
all_on_start: true     # Run all the specs at startup, default: false
launchy: nil           # Pass a path to an rspec results file, e.g. ./tmp/spec_results.html
notification: false    # Display notification after the specs are done running, default: true
run_all: { cmd: 'custom rspec command', message: 'custom message' } # Custom options to use when running all specs
title: 'My project'    # Display a custom title for the notification, default: 'RSpec results'
chdir: 'directory'     # run rspec from within a given subdirectory (useful if project has separate specs for submodules)
results_file: 'some/path' # use the given file for storing results (instead of default relative path)
bundler_env: :original_env # Specify which Bundler env to run the cmd under, default: :original_env
                       # Available values:
                       #  :clean_env - old behavior, uses Bundler environment with all bundler-related variables removed. This is deprecated in bundler 1.12.x.
                       #  :original_env (default) - uses Bundler environment present before Bundler was activated
                       #  :inherit - runs inside the current environment

Using Launchy to view rspec results

guard-rspec can be configured to launch a results file in lieu of outputing rspec results to the terminal. Configure your Guardfile with the launchy option:

guard :rspec, cmd: 'rspec -f html -o ./tmp/spec_results.html', launchy: './tmp/spec_results.html' do
  # ...
end

Zeus Integration

You can use plain Zeus or you can use Guard::Zeus for managing the Zeus server (but you'll want to remove the spec watchers from Guard::Zeus, or you'll have tests running multiple times).

Also, if you get warnings about empty environment, be sure to read about this workaround

Using parallel_tests

parallel_tests has a -o option for passing RSpec options, and here's a trick to make it work with Guard::RSpec:

rspec_options = {
  cmd: "bundle exec rspec",
  run_all: {
    cmd: "bundle exec parallel_rspec -o '",
    cmd_additional_args: "'"
  }
}
guard :rspec, rspec_options do
# (...)

(Notice where the ' characters are placed)

Development

Pull requests are very welcome! Please try to follow these simple rules if applicable:

  • Please create a topic branch for every separate change you make.
  • Make sure your patches are well tested. All specs run with rake spec:portability must pass.
  • Update the README.
  • Please do not change the version number.

For questions please join us in our Google group or on #guard (irc.freenode.net).

Author

Thibaud Guillaume-Gentil (@thibaudgg)

Contributors

https://github.com/guard/guard-rspec/contributors

guard-rspec's People

Contributors

ashmoran avatar benjie avatar bronson avatar cgriego avatar chocoby avatar consu avatar dchelimsky avatar dwilkie avatar e2 avatar georgeguimaraes avatar hedgehog avatar hosamaly avatar indirect avatar jimmycuadra avatar joshrieken avatar killphi avatar kina avatar netzpirat avatar nevir avatar phallstrom avatar rspeicher avatar rymai avatar samsaffron avatar sevos avatar shanesveller avatar slowjack2k avatar thibaudgg avatar tpickett66 avatar wasimakram avatar yujinakayama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

guard-rspec's Issues

Editing a controller triggers test, but changes aren't updated in output

I'm new, but I think I'll love guard if I can get it working! Sorry if this is in the wrong place.

Guard correctly notices changes to files and re-runs tests, but changes to the code in a controller are not updated. For example, a simple test will fail (as expected) the first time the test runs, but when the controller is fixed, the test will re-run but the test will continue to fail. The html output stays the same between each test, when it should have changed. If I stop guard and start it again, it does pick up the change.

If I make a change to a _spec.rb file it acts as it should.

My Guardfile:

guard 'bundler' do
  watch('Gemfile')
end

guard 'livereload' do
  watch(%r{app/.+\.(erb|haml)})
  watch(%r{app/helpers/.+\.rb})
  watch(%r{public/.+\.(css|js|html)})
  watch(%r{config/locales/.+\.yml})
end

guard 'spork', :wait => 50 do
  watch('config/application.rb')
  watch('config/environment.rb')
  watch(%r{^config/environments/.+\.rb$})
  watch(%r{^config/initializers/.+\.rb$})
  watch('spec/spec_helper.rb')
end

guard 'rspec', :version => 2, :cli => "--drb" do
  watch(%r{^spec/(.*)_spec\.rb})
  watch(%r{^app/(.*)\.rb})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^lib/(.*)\.rb})                           { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch('config/routes.rb')                          { "spec/routing" }
  watch('app/controllers/application_controller.rb') { "spec/controllers" }
  watch('spec/support/controller_spec_helpers.rb')   { "spec/controllers" }
  watch('spec/factories.rb')                         { "spec/models" }
  watch('spec/spec_helper.rb')                       { "spec" }
end

Object code failing to reload

When I run rspec with :cli => "--drb such as

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

  watch(%r{^spec/.+_spec\.rb$})
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_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", "spec/requests/#{m[1]}_request_spec.rb"] }
  watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  watch('spec/spec_helper.rb')                        { "spec" }
  watch('config/routes.rb')                           { "spec/routing" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }
  watch(%r{^app/views/(.+)/.+})                       { |m| ["spec/requests/#{m[1]}_request_spec.rb"] }
end

object code fails to reload when it is changed. The test is picked up and re-run, but it doesn't matter how the model code has been changed. I have not been able to track down why it isn't working.

ruby 1.9.2.p290

gem "rails",  "~> 3.0.10"
gem "guard", "~> 0.8.8"
gem "spork", "~> 0.9.0.rc"
gem "guard-spork", "~> 0.3.1"
gem "guard-rspec", "~> 0.5.0"

Allow arbitrary RSpec command line options

I prefer to use the nested formatting for my RSpec output, and it seems it's not possible to invoke RSpec with that option using Guard::RSpec since the :formatter option loads only custom formatters. Perhaps it'd be good to have a way to pass arbitrary command line options to RSpec through Guard, so that Guard::RSpec doesn't have to explicitly curry options to RSpec.

Spec results reported twice?

Hi,

Loving guard and guard-rspec, but I've come across an issue which I'm not sure how to resolve (I'm sure it is something wrong in my configuration but not sure how to proceed):

When I run my specs, I get the following output:

$ guard
Guard is now watching at '/mycomputer/myproject'
Guard::RSpec is running, with RSpec 2!
Running all specs
......

Finished in 0.06 seconds
3 examples, 0 failures

Finished in 0.06 seconds
3 examples, 0 failures```

For some reason, it appears to be running twice. My guardfile is as follows:

group 'specs' do
  guard 'rspec', :notification => false, :version => 2 do
    watch('spec/spec_helper.rb')                        { "spec" }
    watch(%r{^spec/.+_spec\.rb})
    watch(%r{^app/(.+)\.rb})                            { |m| "spec/#{m[1]}_spec.rb" }
    watch(%r{spec/factories/(.+)\.rb})                  { "spec" }
  end
end

group 'wips' do
  guard 'cucumber', :notification => false, :cli => "--require features --profile=wip" do
    watch(%r{app/views/.+})                             { 'features' }
    watch(%r{^features\/(.*).feature})
    watch(%r{features/support/.+})                      { 'features' }
    watch(%r{features/step_definitions/(.+)_steps\.rb}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'features' }
  end
end

Can anyone shed any light on this problem? I think it's me... but just incase...

Kind Regards

Gav

guard running too slow - 8.46 second

I am new to guard

-------- gem file -------

gem 'rails', '3.1.3'


gem 'sqlite3'


group :development, :test do
  gem 'rspec-rails'
  gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git'
  gem 'launchy'
  gem 'database_cleaner'
  gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
  gem 'guard-rspec'
# gem 'guard-livereload'
end

group :test do
gem 'guard-spork'
gem 'ruby_gntp'
end

------- guard file -------

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

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


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') { :rspec }
  watch('test/test_helper.rb') { :test_unit }
  watch(%r{features/support/}) { :cucumber }
end

Run only uncommitted/unstaged

I think it should be very handy to run only new lines, before running the entire spec-file. There is "-l" option, that may help.

Doesn't reload application_helper

I have the following guard block

guard 'rspec', :version => 2, :cli => "--drb", :all_after_pass => false 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{^spec/.+_spec\.rb$})
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_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('spec/spec_helper.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

Everything is working fine, except the when I make a change to the application_helper.rb. Guard does detect the change to the file and runs the tests again. But it seems its still using the previous version, because if I completely remove any method the tests still pass until I reload guard.

Any ideas? Thanks

xargs: unterminated quote

Hi,

I tried guard and guard-rspec in several Ruby 1.9.2 based projects, most with an Rails3 app, some standalone projects.

All share the same problem on osx after each run:

Pending:
 Stuff::Downloader 
    # Not Yet Implemented
    # 

Finished in 0.0003 seconds
1 example, 0 failures, 1 pending
xargs: unterminated quote

(that xargs: unterminated quote)

Any idea? OSX 10.6.8

Lots of error messages when using with spork with custom formatter

I'm not sure why, but I'm getting a lot of these errors:

Break on THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___YOU_MUST_EXEC() to debug. The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().

It does not happen when I call the rspec spec command-line outside guard, WITHOUT the --format NotificationRSpec option. If I use this option, it fails always.

I'm using --drb with spork.

guard-rspec not printing rspec failure

Hi there,

I'm running guard 0.2.0 with rspec 2.5.0, and when rspec has a failure, nothing is printed on the command line. This is how it is configured on Guardfile:

guard 'rspec', :version => 2, :cli => '--color --drb' do ... end

The tests are run, rb-notify even shows that the tests passed (or not), but nothing is printed on the command line!

Any toughts?

Option all_after_pass not executing

I'm not sure if this is related to #53 (I suspect not since it would appear that issue is handled. Just installed in new app I'm building from scratch (Ruby 1.9.3, Rails 3.1.1) and everything seems to be working correctly except running all specs after clearing a failing test.

Using guard (0.8.8)
Using guard-rspec (0.5.4) 
Using spork (0.9.0.rc9) 
Using guard-spork (0.3.1) 

My Guardfile is pretty much untouched. Is anyone else having this problem? Is there something strange with my configuration?

guard 'rspec', :version => 2, :cli => "--drb" 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{^spec/.+_spec\.rb$})
  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{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_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('spec/spec_helper.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

Only run specs in spec/ directory

It's quite common for people to install their bundle under a git ignored directory such as vendor/ruby e.g. by using bundle install --path vendor e.g.http://ryan.mcgeary.org/2011/02/09/vendor-everything-still-applies/

When starting guard it should definitely avoid running the specs under vendor/ruby. I would even say that the gem should be supporting best practices and so should only run the specs under the spec/ directory.

If everyone agrees with this then the only change needed is to update https://github.com/guard/guard-rspec/blob/master/lib/guard/rspec.rb#L30 from ["spec"] to ["spec/"]. Otherwise more logic is needed. Let me know what you think and I'll make a patch.

Exception encountered: #<TypeError: Formatter is not a module>

I get this exception:
Exception encountered: #<TypeError: Formatter is not a module>
backtrace:
/home/anton/.rvm/gems/ruby-1.9.2-p0/bundler/gems/guard-rspec-48c5c925c140/lib/guard/rspec/formatter.rb:3:in `<top (required)>'

guard-spork + guard-rspec with guard-rspec options:
:drb => true, :bundler => false

spork(0.9.0.rc2), rspec-rails(2.4.1)
I tried to specify formatter in options with no luck.
Removing --drb option or running separately spork and rspec --drb spec/ gets no exception and passes specs.

Any idea? Thanks.

Growl notifications broken when used with guard-spork 0.2.1?

It looks like Growl notifications are broken - I'm using Guard 0.6.1, guard-rspec 0.4.2, guard-spork 0.2.1 (with spork 0.9.0-rc9), rails 3.0.9 and rspec 2.6.-0, along with growl_notify 0.0.1

When running Guard for the first time, I get a Growl notification about RSpec starting up: "Spork: RSpec successfully started"

Oddly enough, there was a point when my spork process crashed, and the RSpec growl notifications started appearing once RSpec ran in local mode.

Guard-spec keeps notifying even if -n f (--notify false) guard option is used

Guard-spec keeps notifying even if -n f (--notify false) guard option is used.

That causes the following error for me (i don't want to add guard to gemfile, so that may possibly be a reason), but i'm not absolutely sure why it's called at first place:

  .rvm/gems/ruby-1.9.2-p136/gems/guard-rspec-0.1.9/lib/guard/rspec/formatter.rb:26:in `notify': no such file to load -- guard/notifier (LoadError)

Doesn't watch for file changes on mac os x

Hello!
It seems that's a rare problem. Nothing happens in terminal if I change any file (for example spec_helper.rb). In Gemfile:
gem "factory_girl_rails" gem "capybara" gem "guard-rspec" gem "rb-fsevent" gem "growl" gem "growl_notify" gem 'shoulda-matchers' gem 'shoulda-context' gem 'turn', :require => false
then bundle.
Also tried to install gems through gem install. Specs run if i make ctrl+\ manually.
Could you help?

Rspec 2.7 total time is wrong

Hi,

With the new release of RSpec 2.7 the total time calculation has been modified:

Provide more accurate run time by registering start time before code is loaded (David Chelimsky)
https://www.relishapp.com/rspec/rspec-core/docs/changelog

Check the Finished in *** seconds in the following code. It is calculated from the time guard was started. It doesn't reflect how much the actual test took to run.

$ guard
Guard is now watching at '/Users/Nerian/Projects/davinci'
Starting Spork for RSpec 
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................

Finished in 7.39 seconds
17 examples, 0 failures
Done.


Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................

Finished in 13.07 seconds
17 examples, 0 failures
Done.


Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................

Finished in 18.53 seconds
17 examples, 0 failures
Done.


Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/Nerian/.rvm/gems/ruby-1.9.3-rc1@davinci/gems/guard-rspec-0.5.0/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.................

Finished in 23.64 seconds
17 examples, 0 failures
Done.

Support for RBenv?

Any chance we could get support for RBenv? (an alternative to RVM to run specs against multiple Ruby versions)

guard not working with Growl 1.3

I just installed Growl 1.3 from the Mac App Store. When i run guard start, I get the following error:

```/Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/_aem/findapp.rb:30:inrescue in _find_app': Application "[\"GrowlHelperApp.app\"]" not found. (FindApp::ApplicationNotFoundError) from /Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/_aem/findapp.rb:25:in _find_app'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/_aem/findapp.rb:55:in`rescue in by_name'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/_aem/findapp.rb:49:in `by_name'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/appscript.rb:855:in`by_name'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/appscript.rb:932:in `by_name'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@global/gems/rb-appscript-0.6.1/lib/appscript.rb:994:in`app'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/growl_notify-0.0.1/lib/growl_notify.rb:26:in `register'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/growl_notify-0.0.1/lib/growl_notify.rb:16:in`config'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/guard-0.8.2/lib/guard/notifier.rb:177:in `require_growl'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/guard-0.8.2/lib/guard/notifier.rb:33:in`turn_on'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/guard-0.8.2/lib/guard.rb:36:in `setup'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/guard-0.8.2/lib/guard.rb:104:in`start'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/guard-0.8.2/lib/guard/cli.rb:61:in `start'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/thor-0.14.6/lib/thor/task.rb:22:in`run'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/thor-0.14.6/lib/thor.rb:263:in`dispatch'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/gems/guard-0.8.2/bin/guard:6:in`<top (required)>'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/bin/guard:19:in `load'
from /Users/baron/.rvm/gems/ruby-1.9.2-p290@my-secondlife/bin/guard:19:in`

'




Not sure if this is caused by guard-rspec or one of the dependencies. I am using the following gems: guard-rspec 0.4.5, growl 1.0.3, rb-fsevent 0.4.3.1

rails 3.1 guard-rspec is not seeing changes

MAC OSX, ruby 1.9.2 rails 3.1.

When I run guard and make a change to say a user model with a test it does not seem to see the change I made to make the test pass. If I quit guard and run "rake spec" it runs correctly and sees my changes.

Multiple Guard::RSpec instances don't run all files

I was trying to configure multiple groups as described in the Running a subset of all specs section of the readme, but I found it was only loading files from the last group defined. Here are the guard "rspec" blocks I was using:

guard "rspec", spec_paths: %w[ spec/decorators spec/presenters ], cli: "--color --format Fuubar" do
  watch('spec/spec_helper.rb')                              { %w[ spec/decorators spec/presenters ] }
  watch('spec/environments/decorators.rb')                  { "spec/decorators" }
  watch('spec/environments/presenters.rb')                  { "spec/presenters" }
  watch(%r{^spec/support/(.+)\.rb$})                        { %w[ spec/decorators spec/presenters ] }

  watch(%r{^spec/(?:decorators|presenters)/.+_spec\.rb$})
  watch(%r{^app/(?:decorators|presenters)/(.+)\.rb$})       { |m| "spec/#{m[1]}_spec.rb" }
end

guard "rspec", spec_paths: %w[ spec/models ], cli: "--color --format Fuubar" do
  watch('spec/spec_helper.rb')          { "spec/models" }
  watch('spec/environments/mongoid.rb') { "spec/models" }
  watch(%r{^spec/support/(.+)\.rb$})    { "spec/models" }

  watch(%r{^spec/models/.+_spec\.rb$})
  watch(%r{^app/models/(.+)\.rb$})      { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^app/models/concerns.rb$})   { |m| "spec/models" }
end

I didn't determine what exact circumstances this did and didn't behave correctly. I looked in the code and figured out that the root cause was the Inspector and Runner objects being singletons (everything being defined on a Module).

I've refactored the code to use instantiable classes, and this appears to solve the problem without introducing any side-effects. I'll send a pull request in a second for you to look over, I had to do a few odd things to make the specs pass.

Have rspec exec path option

It appears that bundler 1.1.rc has several issues when used under tmux (e.g Bundler GH Issue #1547). Tmuxinator makes it easy to setup tmux windows and panels for a project so this could be an issue with growing effect.

The problem can be worked around by pointing guard rspec to a executable's path. Specifically bin/rspec. Meaning people have to run bundler install --binstubs, while not nice it does allow them to work around this issue.

not clear if the best place for this is to allow gaurd to have a binstubs option?

Specs are run even if a Pry session is still active

I think this issue only appeared recently.
When I insert a binding.pry command into my specs and guard-rspec initiates the specs and once they hit the binding.pry command, a Pry REPL session is opened (this is completely normal).

However, when I modify any other spec file while the Pry session is active, the specs are run again - ignoring the fact that Pry is waiting for input. This creates a weird problem so that the console window that has guard running in it, no longer displays the input I enter. Even if I Ctrl+C out of guard and get my bash prompt line, entering something on my keyboard no longer shows the characters. I can still type exit and hit Enter and it will work, but nothing is displayed.

Here's my bundle:
https://gist.github.com/1606886

Not rolling back / resetting between runs

It seems that between runs, when I use guard, my database isn't cleared. I have more failing tests in the runs after the first, and the tests that fail are like:

Failure/Error: account = Account.make!
  ActiveRecord::RecordInvalid:
   Validation failed: Email has already been taken
    # ./spec/models/payment_profile_spec.rb:5

I'm using mysql, Ruby 1.8.7, rspec 2.6.1. My spec_helper:

ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
RSpec.configure do |config|
  config.mock_with :rspec
  config.fixture_path = "#{::Rails.root}/spec/fixtures"
  config.use_transactional_fixtures = true
end

How can I ensure that guard resets the database? And is this something I'm supposed to do, or is this a bug?

Excluding some specs in RSpec v1

RSpec 2 adds support for tags, which can be used to prevent running certain tests with guard-rspec. RSpec 1 does not have this feature.

There is a directory of specs that rake spec ignores but I can see no simple way of achieving the same result using guard-rspec. Perhaps an :exclude option could be added and when present subtracted from a glob of all spec files as opposed to using spec?

Something like:

guard 'rspec', :exclude => 'spec/ridiculously_slow_tests/*_spec.rb' do
  # …
end

And then in gaurd-rspec the argument could be passed to Runner:

Guard::RSpec

def initialize(watchers = [], options = {})
  # …
  Runner.excluded_files_glob = options[:excludes]
end

Guard::RSpec::Runner

def rspec_command(paths, options={})
  warn_deprectation(options)

  paths -= Dir[excluded_files_glob] if excluded_files_glob

  cmd_parts = []
  # …
  cmd_parts << paths.join(' ')

  cmd_parts.join(' ')
end

I'm not sure whether you'd want Guard::RSpec::Runner or Guard::RSpec to be responsible for subtracting excluded paths. If you let me know your thoughts I can implement and test this functionality and send you a pull request.

Invalid data format in specification

I used bundler 1.0.15 to install guard 0.6.2 and guard-spec 0.4.2. When I started my rails application, it failed with following message:

Invalid gemspec in [/.rvm/gems/ruby-1.9.2-p180@genesis/specifications/guard-0.6.2.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z"
Invalid gemspec in [
/.rvm/gems/ruby-1.9.2-p180@genesis/specifications/guard-0.6.2.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z"
Invalid gemspec in [~/.rvm/gems/ruby-1.9.2-p180@genesis/specifications/guard-0.6.2.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z"
/Users/jmao/.rvm/gems/ruby-1.9.2-p180@genesis/gems/bundler-1.0.15/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find guard-0.6.2 in any of the sources (Bundler::GemNotFound)

After I manually changed the gemspec file, the problem is gone.

Errors with :cli => "--drb" param

When running guard-rspec with --drb as option for Spork, it runs the test successfully but i receive a lot of errors (see https://gist.github.com/1151368).
It works without any errors when I remove de :cli option or when I run the command "rspec specs/ --drb" in the console. Any idea how i can resolve this problem?

These are my system configuration:
MacOS 10.7
RVM with Ruby 1.9.2 and Rails3.1rc6

Thanks, Gerrit

Run all suite plus updated spec file tests. It should run only the updated one.

Hi, I'm having a strange behavior with guard. I'm working with Rails 3.0.7 with the following gems [1] and the following guradfile [2].

The problem is that when I update a model.rb or a model_spec.rb file, before run all the suite and then run the tests related to the single file. I was trying to check my guard configuration file, but I couldn't find any motivation for this. The same behavior is happening on a gem I'm working on as a wrapper, so it does not seem to be limited on Rails.

Thanks a lot.

[1] http://pastie.org/1899780
[2] http://pastie.org/1899783

Re-run all specs after failure fixed

One thing that I've found myself missing in my workflow after switching from autotest is that when a spec is failing, and then I make it pass, that it run all the specs afterwards.

There are times when I change something that breaks some unit specs, and then I fix them, but i forget to fix other specs that may also be relying on old behavior. I never see those problems unless I go looking for them. I like that autotest allows me to focus on one thing in isolation, but I also like to have total verification that the specs pass before I move onto the next task.

Option all_after_pass is broken

aebebdb breaks all_after_pass as Runner.run's return value is used in the Guard::RSpec.run-methods to detect run failures but with this change Runner.run will always return true.

I am not sure about this commit's intent, but as it stands it will display an extra "Failed" notifier whenever rspec detects an error, which is quite useless. I suggest reverting this commit.

Don't always run all specs

I'd love the option to only run all failing specs if the previous run had a failing spec. So it would work like this:

  1. Fail
  2. Fix
  3. Pass
  4. Run All

But if I did this:

  1. Fail
  2. Fix
  3. Pass
  4. Run All
  5. Pass

There would not be a "6. Run All". A lot of times refactoring includes just modifying some whitespace or moving methods around. Running the full spec suite after such things isn't needed.

This may be able to be done with a flag. Once a failure is recorded, it sets the "run all" flag, then when all are passing, it runs the full suite and resets the "run all" flag.

Just throwing out ideas. Great gem. Between this, Guard and Spork it actually makes me enjoy TDD again.

Notifications are not working

I am using:

  • guard-rails-assets
  • guard-rspec
  • guard-spork

When I run bundle exec guard I get the following notifications:

  • Guard - Guard: Assets compiled
  • Guard - Spork: RSpec successfully started

But I don't get any notifications from Rspec. It doesn't notify me about the results of running the test suite. I tried many times, but I get no notification.

group :test do
  gem 'rspec'
  gem "rspec-rails"
  gem 'guard-rspec'
  gem 'rb-fsevent'
  #gem 'growl'
  gem 'rb-readline'
  gem 'ruby_gntp'
  gem 'guard-spork'
  gem 'spork', '~> 0.9.0.rc'
  gem 'guard-rails-assets'
end

# It is recommended to make explicit list of assets in `config/application.rb`
# config.assets.precompile = ['application.js', 'application.css', 'all-ie.css']
guard 'rails-assets', :run_on => [:start, :change], :runner => :rails, :rails_env => 'test' do
  watch(%r{^app/assets/.+$})
  watch('config/application.rb')
end

guard 'spork',
  :rspec => true,
  :test_unit => false,
  :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(%r{^app/(.+)\.rb$})
    watch('Gemfile')
    watch('Gemfile.lock')
    watch('spec/spec_helper.rb')
    watch('test/test_helper.rb')
end

guard 'rspec', :version => 2, :notification => true, :cli => "--drb", :keep_failed => false do
  watch(%r{^spec/fabricators/.+_fabricator\.rb$})     { "spec" }    
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^lib/(.+)\.rb$})                           { |m| "spec/lib/#{m[1]}_spec.rb" }

  watch(%r{^spec/acceptance/(.+)\.rb$})
  watch(%r{^spec/models/(.+)\.rb$})
  watch(%r{^spec/controllers/(.+)\.rb$})

  watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  watch('spec/spec_helper.rb')                        { "spec" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }
end

specs located out of Rails.root/spec/ not being notified to run

I'm having an issue where I instruct guard to watch a file and pass it a block with a path to the accompanying spec file to run, but the spec file does not run. If I replace the block with a command to puts "hello world" it executes just fine.

Here is a snippet of my Guard file:

guard 'rspec', :version => 2, :cli => "--pattern pages/spec/**/*_spec.rb --format Fuubar --color --drb" do
  watch(%r{^pages/spec/.+_spec\.rb$})
  watch(%r{^pages/app/(.+)\.rb$})                           { |m| "pages/spec/#{m[1]}_spec.rb" }
  watch(%r{^pages/lib/(.+)\.rb$})                           { |m| "pages/spec/lib/#{m[1]}_spec.rb" }
  watch(%r{^pages/app/controllers/(.+)_(controller)\.rb$})  { |m| ["pages/spec/routing/#{m[1]}_routing_spec.rb", "pages/spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "pages/spec/acceptance/#{m[1]}_spec.rb"] }
  watch(%r{^pages/spec/support/(.+)\.rb$})                  { "pages/spec" }
  watch("pages/spec/spec_helper.rb")                        { "pages/spec" }
  watch("pages/config/routes.rb")                           { "pages/spec/routing" }
  watch("pages/app/controllers/application_controller.rb")  { "pages/spec/controllers" }
end

I'm running OSX 10.7.0, Ruby 1.9.2-p290, Rails 3.1 rc5, Guard 0.5.1, guard-rspec 0.4.1

Ubuntu 10.10, 11.04 Rails 3.1.0.rc4 -- same issue with guard, guard-rspec, and guard-cucumber

I can install, guard, guard-rspec, and guard-cucumber folloowing the instructions. It initializes the Guardfile properly, as far as I can tell. And when I use

guard start

or just

guard

it seems to run fine, going through each of the tests.

However when I modify a file, it doesn't seem to be running the tests and/or features again, as advertised. You can see my code, including specs, Gemfile, and Guardfile using the "guard" branch of a project I'm working on called skygodlin, here:

[email protected]:fdschoeneman/skygodlin.git

Thanks!

Not an issue, but should be a warning?

So tonight I was running some tests and wasn't paying attention that I had 2 guard's running (same dir/same guardfile). IMHO, an error should be thrown if it detects another guard running? Maybe if its running in the same directory, or the same Guard file (since people could probably have different projects running multiple guards).

tests run once, and guard stop with command prompt

Hi,

as the title says, when i run 'guard', all my tests run once, and then show 'Done' and stop with a command prompt.

DEBUG (16:08:39): Command execution: bundle exec rspec -f progress -r /Users/pipo/.rvm/gems/ruby-1.9.2-p290/gems/guard-rspec-0.5.9/lib/guard/rspec/formatters/notification_rspec.rb -f Guard::RSpec::Formatter::NotificationRSpec --out /dev/null --failure-exit-code 2 spec
.............................

Finished in 3.62 seconds
29 examples, 0 failures
DEBUG (16:08:43): Hook :start_end executed for Guard::RSpec

i tried everything, i don't know what to do ... I have nothing special on any project. It was working this morning...

thanks for help

Charlie

Notifications are not working through ruby_gntp

I see that the recommended gem to enable Growl notifications is ruby_gntp.

I'm just defining these gems in my Gemfile:

group :development do
  gem 'guard'
  gem 'guard-rspec'
  gem 'guard-spork'
end

group :test, :development do
  gem 'rspec-rails'
  gem 'spork'
  gem 'growl'
  gem 'ruby_gntp'
end

group :test do
  gem 'rb-fsevent'
  gem 'webrat'
end

I run guard and it gives me the ERROR: Error sending notification with gntp: Connection refused - connect(2):

Guard uses GNTP to send notifications.
Guard is now watching at '/Users/david/Sites/rails_tutorials/rails_tutorial'
Starting Spork for RSpec
NOTE: Gem.latest_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.latest_load_paths called from /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/spork-0.8.5/lib/spork.rb:112.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:603.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:603.
Using RSpec
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
ERROR: Error sending notification with gntp: Connection refused - connect(2)
Guard::RSpec is running, with RSpec 2!
Running all specs
ERROR: Error sending notification with gntp: Connection refused - connect(2)

I have enabled the "Listen for incoming notifications" option in my Growl settings.
By the way, iTunes notifications work fine through Growl, as well as Adium and other apps. So I think my Growl installation is ok.

My system is OS X Lion 10.7.2, and my Growl version is 1.2

Is this issue related to the ruby_gntp gem?

cli options specified in :run_all should merge

I have guard configured with the option: :cli => "--drb --format d". When running all my specs, I want to exclude those that use selenium with :run_all => { :cli => "--tag ~js" }. This works, but requires I re-specify my original :cli options as well.

It'd be nice if the cli options were merged.

Still no growl notifications nor summary.

Using rspec 2.6.0, guard-rspec 0.4.2, guard 0.6.2, spork 0.9.0.rc9, growl_notify 0.0.1 I am not getting any Growl notifications at all. Also the summary when running all specs is missing, it looks like:

...
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--format", "progress", "--format", "NotificationRSpec", "--out", "/dev/null", "--require", "/Users/carhartl/Workspace/tweek.tv/vendor/bundle/ruby/1.9.1/gems/guard-rspec-0.4.2/lib/guard/rspec/formatters/notification_rspec.rb", "spec/"]...
.....................................*..........................................................................................................................................................................................................................................................................Done.

Compiling rails assets with Guard::RailsAssets::RailsRunner.
...

What does the "--out", "/dev/null"option do there?

Can you switch from running all tests to a subset of tests without restarting Guard?

I was hoping that there would be a way to get guard to run just tests with a certain tag. I know that you can set this in the guard file with the :cli option, but if I do that I need to quit guard and start it again. I thought I could maybe use the reload keyboard shortcut for Guard to reload the :cli options, but that doesn't seem to do anything.

Hopefully what I am trying to describe is coming across. Any thoughts on how I could do this, or if it is even possible to implement if it isn't already?

rspec tags: key-value tags not getting passed but simple tags work

when passing :cli => "--color --format nested --fail-fast --drb --tag ~slow --tag ~type:request" in guardfile, the actual running command according to the output is
Running tests with args ["--color", "--fail-fast", "--tag", "~slow", "--tag", "~type", ...(snip)
Run filtered excluding {:slow=>true, :type=>true}

type tag gets set to true and not request.

Is anyone else seeing this?

Thanks...

Notifications: Warn when specs can't be executed

It would be very nice to be notified if the specs don't run due to syntax errors or the like.

I tend to maximize my editor and rely on the libnotify notifications to see whether my specs pass or not. Sometimes I make typos or other syntax errors which result in an error message in the terminal only. There is no indication that something went wrong via desktop notification, and I always sit there a second or two after saving, wondering if the tests just took a little longer than usual, before switching over to the terminal and discovering the error message.

Guard does not run rspec tests

I set everything up and run guard and it sits there. Says running all specs then nothing. I chage a spec file. It says running that spec file then outputs nothing. The specs run as they should when I type the command "rspec spec/".

Note: I am using guard with a gem and not a rails project.

Thanks in advance for any help.

Why libnotify stoped showing Rspec notifications?

My Guardfile: http://pastie.org/3160573

My spec_helper: http://pastie.org/3160578

When I initialize guard:

Running tests with args ["--color", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/home/rege/.rvm/gems/ruby-1.9.2-p290/gems/guard-rspec-0.5.10/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...

How to diagnose where is the problem?

http://stackoverflow.com/questions/8805278/why-libnotify-stoped-showing-rspec-notifications

No RSpec output when using growl notifications

I have no RSpec output on the terminal when using guard + guard-rspec + growl

I have installed the growlnotify utility, and the growl gem.

This is my output:

Guard uses Growl to send notifications.
Guard is now watching at '/Users/david/Sites/rails_tutorials/rails_tutorial'
Starting Spork for RSpec
NOTE: Gem.latest_load_paths is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.latest_load_paths called from /Users/david/.rvm/gems/ruby-1.9.3-p0/gems/spork-0.8.5/lib/spork.rb:112.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:603.
NOTE: Gem.all_partials is deprecated with no replacement. It will be removed on or after 2011-10-01.
Gem.all_partials called from /Users/david/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:603.
Using RSpec
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
Running: spec/controllers/pages_controller_spec.rb

I don't mind not having RSpec output when tests pass, but when they fail I need to see what happened.

If I disable notifications via :notification => false then yes, I get RSpec output in the terminal window.

If this issue is guard related, please tell me to move it.

feature request: ability to define 'all' to anything else than './spec'

Let's say someone wants to run acceptance specs in one process and unit tests in another one.

It would be handy in that case to define 'all' as different sets of directories in both of this groups.

Best way I can think of is to define option that would hold an array of paths to pass to runner on run_all event e.g.

guard 'rspec', :all_specs => ['spec/acceptance']

guard 'rspec', :all_specs => ['spec/models', 'spec/controllers', 'spec/routes', 'spec/helpers']

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.