Skip to content

Commit

Permalink
Add documentation for how spec files are required/run.
Browse files Browse the repository at this point in the history
Closes 623.

Signed-off-by: Sam Phippen <samphippen@googlemail.com>
  • Loading branch information
Sam Phippen committed Jun 3, 2013
1 parent 008839c commit c3983b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -28,6 +28,11 @@ Initialize the `spec/` directory (where specs will reside) with:
rails generate rspec:install
```

This adds the spec directory and some skeleton files, including the "rake spec"
task. Any ruby file in `spec/support` will be included with `require`. All
files in spec/ and subdirectories that end with `_spec.rb` will be run as
specs.

To run your specs, use the `rspec` command:

```
Expand Down
Expand Up @@ -5,7 +5,11 @@ require 'rspec/rails'
require 'rspec/autorun'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
# in spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb`
# are run as spec files by default. This means that files in spec/support that
# end in _spec.rb will both be required and run as specs, causing the specs
# to be run twice. It is recommended that you do not name files matching
# this glob to end with _spec.rb.
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }

<% if ::Rails::VERSION::STRING >= '4' -%>
Expand Down

0 comments on commit c3983b7

Please sign in to comment.