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

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 listspec_paths: ['spec'] # Specify a custom array of paths that contain spec filesfailed_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 reportall_after_pass:true# Run all specs after changed specs pass, default: falseall_on_start:true# Run all the specs at startup, default: falselaunchy:nil# Pass a path to an rspec results file, e.g. ./tmp/spec_results.htmlnotification:false# Display notification after the specs are done running, default: truerun_all: { cmd:'custom rspec command', message:'custom message' } # Custom options to use when running all specstitle:'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)

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: