Skip to content

Commit

Permalink
tweak Upgrade.markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
dchelimsky committed Oct 6, 2010
1 parent d0ea23a commit fc37841
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions Upgrade.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Or, if you're using bundler:

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

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

The root namespace (top level module) is now `RSpec` instead of `Spec`, and
the root directory under `lib` within all of the `rspec` gems is `rspec` instead of `spec`.
Expand All @@ -56,47 +56,47 @@ Typically in `spec/spec_helper.rb`, configuration is now done like this:
# ....
end

### .rspec

Command line options can be persisted in a `.rspec` file in a project. You
can also store a `.rspec` file in your home directory (`~/.rspec`) with global
options. Precedence is:

command line
./.rspec
~/.rspec

### Bones

Bones produces a handy little Rakefile to provide several services including
running specs. The current version (3.4.7) still assumes RSpec-1. To bring its
Rakefile into conformance with RSpec-2 a few changes are necessary.

1. Note that the require line has changed to:

require 'spec/rake/spectask'
1. The require line has changed to `require 'spec/rake/spectask'`

2. The `spec_opts` accessor has been deprecated in favor of `rspec_opts`. Also, the
`rspec` command no longer supports the `--options` command line option so the
options must be embedded directly in the Rakefile.
2. The `spec_opts` accessor has been deprecated in favor of `rspec_opts`. Also,
the `rspec` command no longer supports the `--options` command line option
so the options must be embedded directly in the Rakefile, or stored in the
`.rspec` files mentioned above.

3. The `spec_files` accessor has been replaced by `pattern`.
3. The `spec_files` accessor has been replaced by `pattern`.

Here is a complete example:

# rspec-1
Spec::Rake::SpecTask.new do |t|
t.spec_opts = ['--options', "\"spec/spec.opts\""]
t.spec_files = FileList['spec/**/*.rb']
end

becomes:

# rspec-2
RSpec::Core::RakeTask.new do |t|
t.rspec_opts = ["-c", "-f progress", "-r ./spec/spec_helper.rb"]
t.pattern = 'spec/**/*_spec.rb'
end


### .rspec

Command line options can be persisted in a `.rspec` file in a project. You
can also store a `.rspec` file in your home directory (`~/.rspec`) with global
options. Precedence is:

command line
./.rspec
~/.rspec

### `context` is no longer a top-level method

We removed `context` from the main object because it was creating conflicts with
Expand Down

0 comments on commit fc37841

Please sign in to comment.