Skip to content

Commit 938d55c

Browse files
committed
Documentation updates
[ci skip]
1 parent 12ce292 commit 938d55c

File tree

1 file changed

+36
-12
lines changed

1 file changed

+36
-12
lines changed

README.md

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,58 @@
11
# rspec-rails [![Build Status](https://secure.travis-ci.org/rspec/rspec-rails.png?branch=master)](http://travis-ci.org/rspec/rspec-rails) [![Code Climate](https://codeclimate.com/github/rspec/rspec-rails.png)](https://codeclimate.com/github/rspec/rspec-rails)
22

3-
**rspec-rails 2** is a testing framework for Rails 3.x and 4.x.
3+
**rspec-rails** is a testing framework for Rails 3.x and 4.x.
44

5-
Use **[rspec-rails 1](http://github.com/dchelimsky/rspec-rails)** for Rails 2.x.
5+
Use **[rspec-rails 1.x](http://github.com/dchelimsky/rspec-rails)** for Rails
6+
2.x.
67

7-
## Install
8+
## Installation
89

9-
Add `rspec-rails` to the `:test` and `:development` groups in the Gemfile:
10+
Add `rspec-rails` to **both** the `:development` and `:test` groups in the
11+
`Gemfile`:
1012

1113
```ruby
12-
group :test, :development do
13-
gem "rspec-rails", "~> 2.0"
14+
group :development, :test do
15+
gem 'rspec-rails', '~> 2.0'
1416
end
1517
```
1618

17-
It needs to be in the `:development` group to expose generators and rake
18-
tasks without having to type `RAILS_ENV=test`.
19+
Download and install by running:
1920

20-
Now you can run:
21+
```
22+
bundle install
23+
```
24+
25+
Initialize the `spec/` directory (where specs will reside) with:
2126

2227
```
2328
rails generate rspec:install
2429
```
2530

26-
This adds the spec directory and some skeleton files, including
27-
the "rake spec" task.
31+
To run your specs, use the `rspec` command:
32+
33+
```
34+
bundle exec rspec
35+
36+
# Run only model specs
37+
bundle exec rspec spec/models
38+
39+
# Run only specs for AccountsController
40+
bundle exec rspec spec/controllers/accounts_controller_spec.rb
41+
```
42+
43+
Specs can also be run via `rake spec`, though this command may be slower to
44+
start than the `rspec` command.
45+
46+
In Rails 4, you may want to create a binstub for the `rspec` command so it can
47+
be run via `bin/rspec`:
48+
49+
```
50+
bundle binstubs rspec-core
51+
```
2852

2953
### Generators
3054

31-
Once installed, RSpec will generate spec file instead of Test::Unit test files
55+
Once installed, RSpec will generate spec files instead of Test::Unit test files
3256
when commands like `rails generate model` and `rails generate controller` are
3357
used.
3458

0 commit comments

Comments
 (0)