Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Jan 27, 2011
1 parent 4521850 commit 1a66ce9
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 84 deletions.
1 change: 1 addition & 0 deletions features/.nav
@@ -1,5 +1,6 @@
- Upgrade.md - Upgrade.md
- Changelog.md - Changelog.md
- Autotest.md
- example_groups: - example_groups:
- basic_structure.feature - basic_structure.feature
- shared_example_group.feature - shared_example_group.feature
Expand Down
44 changes: 44 additions & 0 deletions features/Autotest.md
@@ -0,0 +1,44 @@
RSpec ships with a specialized subclass of Autotest. You can pass the --style
option to the autotest command to tell Autotest to load this subclass:

$ autotest --style rspec2

Alternatively, you can configure your project such that this happens
automatically, in which case you can just type:

$ autotest

Here's how:

#### rspec-2.3 and up

Add a .rspec file to the project's root directory if it's not already there.
You can use this to configure RSpec options, but you don't have to. As long as
RSpec sees this file, it will tell Autotest to use the "rspec2" style.

#### rspec-2.2 and down

Add an autotest directory to the project root, and add a file named discover.rb to
that directory with the following:

# in ./autotest/discover.rb
Autotest.add_discovery {"rspec2"}

NOTE that this approach will not be supported by future versions of ZenTest on
Ruby-1.9.

### `bundle exec`

By default, RSpec adds `bundle exec` to the command generated by Autotest if
there is a `Gemfile` in the project root directory.

As of rspec-core-2.5, this automatic inclusion of 'bundle exec' is deprecated.
If you want to include 'bundle exec', use Autotest's bundler plugin by adding
a .autotest file to the project root directory with the following:

require 'autotest/bundler'

If you want to skip 'bundle exec', pass `--skip-bundler` to the `autotest`
command and it won't include `bundle exec` even if there is a `Gemfile`.

autotest -- --skip-bundler
38 changes: 4 additions & 34 deletions features/README.md
Expand Up @@ -8,40 +8,10 @@ rspec-core provides the structure for RSpec code examples:
end end
end end


### Autotest integration

RSpec ships with a specialized subclass of Autotest. You can pass the --style
option to the autotest command to tell Autotest to load this subclass:

$ autotest --style rspec2

Alternatively, you can configure your project such that this happens
automatically, in which case you can just type:

$ autotest

Here's how:

#### rspec-2.3 and up

Add a .rspec file to the project's root directory if it's not already there.
You can use this to configure RSpec options, but you don't have to. As long as
RSpec sees this file, it will tell Autotest to use the "rspec2" style.

#### rspec-2.2 and down

Add an autotest directory to the project root, and add a file named discover.rb to
that directory with the following:

# in ./autotest/discover.rb
Autotest.add_discovery {"rspec2"}

## Issues ## Issues


The documentation for rspec-core is a work in progress. We'll be adding This documentation is [open
Cucumber features over time, and clarifying existing ones. If you have source](https://github.com/rspec/rspec-core/tree/master/features), and a work
specific features you'd like to see added, find the existing documentation in progress. If you find it incomplete or confusing, please [submit an
incomplete or confusing, or, better yet, wish to write a missing Cucumber issue](http://github.com/rspec/rspec-core/issues), or, better yet, [a pull
feature yourself, please [submit an
issue](http://github.com/rspec/rspec-core/issues) or a [pull
request](http://github.com/rspec/rspec-core). request](http://github.com/rspec/rspec-core).
54 changes: 4 additions & 50 deletions features/Upgrade.md
@@ -1,33 +1,3 @@
# rspec-core-2.5

## autotest

### 2.5

By default, RSpec adds `bundle exec` to the command generated by Autotest if
there is a `Gemfile` in the project root directory.

As of rspec-core-2.5, this automatic inclusion of 'bundle exec' is deprecated.
If you want to include 'bundle exec', use Autotest's bundler plugin by adding
a .autotest file to the project root directory with the following:

require 'autotest/bundler'

If you want to skip 'bundle exec', pass `--skip-bundler` to the `autotest`
command and it won't include `bundle exec` even if there is a `Gemfile`.

autotest -- --skip-bundler

### 2.3

As of rspec-core-2.3, RSpec's Autotest extension is loaded when you run the
`autotest` command if there is a `.rspec` file in the project's root directory.

NOTE that rspec-core-2.0, 2.1, and 2.2 required an autotest/discover.rb file in
the project's root directory. This worked with some, but not all versions of
autotest and/or the autotest command that ships with ZenTest. This new approach
works regardless of which version of autotest/ZenTest you are using.

# rspec-core-2.3 # rspec-core-2.3


## `config.expect_with` ## `config.expect_with`
Expand Down Expand Up @@ -193,9 +163,9 @@ passed to `it_should_behave_like`.
See [features/example\_groups/shared\_example\_group.feature](http://github.com/rspec/rspec-core/blob/master/features/example_groups/shared_example_group.feature) for more information. See [features/example\_groups/shared\_example\_group.feature](http://github.com/rspec/rspec-core/blob/master/features/example_groups/shared_example_group.feature) for more information.


NOTICE: The including example groups no longer have access to any of the NOTICE: The including example groups no longer have access to any of the
methods, hooks, or state defined inside a shared group. This will break specs methods, hooks, or state defined inside a shared group. This will break rspec-1
that were using shared example groups to extend the behavior of including specs that were using shared example groups to extend the behavior of including
groups in any way besides their intended purpose: to add examples to a group. groups.


# Upgrading from rspec-1.x # Upgrading from rspec-1.x


Expand Down Expand Up @@ -266,23 +236,7 @@ A few things changed in the Rake task used to run specs:


### autotest ### autotest


RSpec-2 works with autotest as follows: `autospec` is dead. Long live `autotest`.

rspec --configure autotest

This adds `./autotest/discover.rb` with:

Autotest.add_discovery { "rspec2" }

Now, on the command line just type:

autotest

Or, if you're using bundler:

bundle exec autotest

The `autospec` command is a thing of the past.


### RSpec is the new Spec ### RSpec is the new Spec


Expand Down

0 comments on commit 1a66ce9

Please sign in to comment.