Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

rspec(1) [debian man page]

RSPEC(1)																  RSPEC(1)

NAME
rspec - standalone test runner for Ruby RSpec test suites SYNOPSYS
rspec [options] [files or directories] DESCRIPTION
The Ruby script rspec allows you to run tests written with RSpec, a testing tool for Ruby, from the command line. When run without arguments, rspec finds automatically all the spec files of your projects, and runs them. It is possible to restrict the tests to a subset by specifying the names of particular spec files or by using some of the filtering options. Various options can be passed to rspec to modify the output of the tests, or the way the tests are run. OPTIONS
-I PATH Specify PATH to add to $LOAD_PATH (may be used more than once). -r, --require PATH Require a file. -O, --options PATH Specify the path to a custom options file. --order TYPE[:SEED] Run examples by the specified order type. TYPE can be either default, for which files are ordered based on the underlying file system's order, or rand, for which the order of files, groups and examples is randomized. random is an alias for rand. A SEED can be indicated for the random type, e.g. --order random:123 --seed SEED Equivalent of --order rand:SEED. -d, --debugger Enable debugging. --fail-fast Abort the run on first failure. --failure-exit-code CODE Override the exit code used when there are failing specs. -X, --[no-]drb Run examples via DRb. --drb-port PORT Port to connect to the DRb server. --init Initialize your project with RSpec. --configure Deprecated. Use --init instead. OUTPUT OPTIONS
-f, --format FORMATTER Choose a formatter. The various choices are [p]rogress (default - dots), [d]ocumentation (group and example names), [h]tml, [t]extmate or a custom formatter class name. -o, --out FILE Write output to a file instead of STDOUT. This option applies to the previously specified --format, or the default format if no format is specified. -b, --backtrace Enable full backtrace. -c, --[no-]color, --[no-]colour Enable color in the output. -p, --profile Enable profiling of examples and list 10 slowest examples. FILTERING AND TAG OPTIONS
In addition to the following options for selecting specific files, groups, or examples, you can select a single example by appending the line number to the filename: rspec path/to/a_spec.rb:37 -P, --pattern PATTERN Load files matching pattern (default: "spec/**/*_spec.rb"). -e, --example STRING Run examples whose full nested names include STRING. -l, --line_number LINE Specify line number of an example or group (may be used more than once). -t, --tag TAG[:VALUE] Run examples with the specified tag, or exclude examples by adding ~ before the tag, e.g. ~slow. TAG is always converted to a symbol. --default_path PATH Set the default path where RSpec looks for examples (can be a path to a file or a directory). UTILITY OPTIONS
-v, --version Display the version. -h, --help Display a message similar to this manpage. AUTHORS
This man page inspired by the help message of rspec, has been written by Cedric Boutillier for the Debian Project, but may be used by others. 2012-02-14 RSPEC(1)

Check Out this Related Man Page

BUNDLE-EXEC(1)															    BUNDLE-EXEC(1)

NAME
bundle-exec - Execute a command in the context of the bundle SYNOPSIS
bundle exec command DESCRIPTION
This command executes the command, making all gems specified in the Gemfile(5) available to require in Ruby programs. Essentially, if you would normally have run something like rspec spec/my_spec.rb, and you want to use the gems specified in the Gemfile(5) and installed via bundle install(1) bundle-install.1.html, you should run bundle exec rspec spec/my_spec.rb. Note that bundle exec does not require that an executable is available on your shell's $PATH. BUNDLE INSTALL --BINSTUBS If you use the --binstubs flag in bundle install(1) bundle-install.1.html, Bundler will automatically create a directory (which defaults to app_root/bin) containing all of the executables available from gems in the bundle. After using --binstubs, bin/rspec spec/my_spec.rb is identical to bundle exec rspec spec/my_spec.rb. ENVIRONMENT MODIFICATIONS
bundle exec makes a number of changes to the shell environment, then executes the command you specify in full. o make sure that it's still possible to shell out to bundle from inside a command invoked by bundle exec (using $BUNDLE_BIN_PATH) o put the directory containing executables (like rails, rspec, rackup) for your bundle on $PATH o make sure that if bundler is invoked in the subshell, it uses the same Gemfile (by setting BUNDLE_GEMFILE) o add -rbundler/setup to $RUBYOPT, which makes sure that Ruby programs invoked in the subshell can see the gems in the bundle It also modifies Rubygems: o disallow loading additional gems not in the bundle o modify the gem method to be a no-op if a gem matching the requirements is in the bundle, and to raise a Gem::LoadError if it's not o Define Gem.refresh to be a no-op, since the source index is always frozen when using bundler, and to prevent gems from the system leak- ing into the environment o Override Gem.bin_path to use the gems in the bundle, making system executables work o Add all gems in the bundle into Gem.loaded_specs Shelling out When shelling out (using the system or backticks methods, for example), Bundler's environment changes will propogate to the subshell envi- ronment. If you desire to shell out without Bundler's environment changes, simply employ the with_clean_env method. It will restore all environment variables to what they were before Bundler was activated. For example: Bundler.with_clean_env do `brew install wget` end RUBYGEMS PLUGINS
At present, the Rubygems plugin system requires all files named rubygems_plugin.rb on the load path of any installed gem when any Ruby code requires rubygems.rb. This includes executables installed into the system, like rails, rackup, and rspec. Since Rubygems plugins can contain arbitrary Ruby code, they commonly end up activating themselves or their dependencies. For instance, the gemcutter 0.5 gem depended on json_pure. If you had that version of gemcutter installed (even if you also had a newer version without this problem), Rubygems would activate gemcutter 0.5 and json_pure <latest>. If your Gemfile(5) also contained json_pure (or a gem with a dependency on json_pure), the latest version on your system might conflict with the version in your Gemfile(5), or the snapshot version in your Gemfile.lock. If this happens, bundler will say: You have already activated json_pure 1.4.6 but your Gemfile requires json_pure 1.4.3. Consider using bundle exec. In this situation, you almost certainly want to remove the underlying gem with the problematic gem plugin. In general, the authors of these plugins (in this case, the gemcutter gem) have released newer versions that are more careful in their plugins. You can find a list of all the gems containing gem plugins by running ruby -rubygems -e "puts Gem.find_files('rubygems_plugin.rb')" At the very least, you should remove all but the newest version of each gem plugin, and also remove all gem plugins that you aren't using (gem uninstall gem_name). June 2012 BUNDLE-EXEC(1)
Man Page