Notes:
This release introduces #describe and #it (aliased as #context and #specify for
backwards compatibility). This allows you to express specs like this:
describe SomeClass do # Creates a Behaviour
it "should do something" do # Creates an Example
end
end
The command line features four new options that give you more control over what specs
are being run and in what order. This can be used to verify that your specs are
independent (by running in opposite order with --reverse). It can also be used to cut
down feedback time by running the most recently modified specs first (--loadby mtime --reverse).
Further, --example replaces the old --spec option, and it can now take a file name of
spec names as an alternative to just a spec name. The --format failing_examples:file.txt
option allows you to output an --example compatible file, which makes it possible to only
rerun the specs that failed in the last run. Spec::Rails uses all of these four options
by default to optimise your RSpec experience.
There is now a simple configuration model. For Spec::Rails, you do something like this:
Spec::Runner.configure do |config|
config.use_transactional_fixtures = true
config.use_instantiated_fixtures = false
config.fixture_path = RAILS_ROOT + '/spec/fixtures'
end
You can now use mocha or flexmock with RSpec if you prefer either to
RSpec's own mock framework. Just put this:
Spec::Runner.configure do |config|
config.mock_with :mocha
end
or this:
Spec::Runner.configure do |config|
config.mock_with :flexmock
end
in a file that is loaded before your specs. You can also
configure included modules and predicate_matchers:
Spec::Runner.configure do |config|
config.include SomeModule
config.predicate_matchers[:does_something?] = :do_something
end
See Spec::DSL::Behaviour for more on predicate_matchers
Changes:
* Sugar FREE!
* Added [10434 ] Please Make -s synonymous with -e for autotest compat. This is temporary until autotest uses -e instead of -s.
* Fixed [#10133] custom predicate matchers
* Applied [#10473] Add should exist (new matcher) - Patch from Bret Pettichord
* Added another formatter: failing_behaviours. Writes the names of the failing behaviours for use with --example.
* Applied [#10315] Patch to fix pre_commit bug 10313 - pre_commit_rails: doesn't always build correctly (Patch from Antii Tarvainen)
* Applied [#10245] Patch to HTML escape the behavior name when using HTML Formatter (Patch from Josh Knowles)
* Applied [#10410] redirect_to does not behave consistently with regards to query string parameter ordering (Patch from Nicholas Evans)
* Applied [#9605] Patch for ER 9472, shared behaviour (Patch by Bob Cotton)
* The '--format rdoc' option no longer causes a dry-run by default. --dry-run must be used explicitly.
* It's possible to specify the output file in the --format option (See explanation in --help)
* Several --format options may be specified to output several formats in one run.
* The --out option is gone. Use --format html:path/to/my.html instead (or similar).
* Spec::Runner::Formatter::BaseTextFormatter#initialize only takes one argument - an IO. dry_run and color are setters.
* Made Spec::Ui *much* easier to install. It will be released separately. Check out trunk/spec_ui/examples
* HTML reports now include a syntax highlighted snippet of the source code where the spec failed (needs the syntax gem)
* Added [#10262] Better Helper testing of Erb evaluation block helpers
* Added [#9735] support flexmock (thanks to Jim Weirich for his modifications to flexmock to support this)
* Spec::Rails controller specs will no longer let mock exception ripple through to the response.
* Fixed [#9260] IvarProxy does not act like a hash.
* Applied [#9458] The rspec_resource generator does not take into account class nesting (Patch from Steve Tendon)
* Applied [#9132] Rakefile spec:doc can fail without preparing database (Patch from Steve Ross)
* Applied [#9678] Custom runner command line switch, and multi-threaded runner (Patch from Bob Cotton)
* Applied [#9926] Rakefile - RSPEC_DEPS constant as an Array of Hashes instead of an Array of Arrays (Patch from Scott Taylor)
* Applied [#9925] Changed ".rhtml" to "template" in REST spec generator (Patch from Scott Taylor)
* Applied [#9852] Patch for RSpec's Website using Webgen 0.4.2 (Patch from Scott Taylor)
* Fixed [#6523] Run rspec on rails without a db
* Fixed [#9295] rake spec should run anything in the spec directory (not just rspec's standard dirs)
* Added [#9786] infer controller and helper names from the described type
* Fixed [#7795] form_tag renders action='/view_spec' in view specs
* Fixed [#9767] rspec_on_rails should not define rescue_action on controllers
* Fixed [#9421] --line doesn't work with behaviours that use class names
* Fixed [#9760] rspec generators incompatible with changes to edge rails
* Added [#9786] infer controller and helper names from the described type
* Applied a simplified version of [#9282] Change to allow running specs from textmate with rspec installed as a rails plugin (and no rspec gem installed)
* Applied [#9700] Make Spec::DSL::Example#name public / Add a --timeout switch. A great way to prevent specs from getting slow.
* In Rails, script/generate rspec will generate a spec.opts file that optimises faster/more efficient running of specs.
* Added [#9522] support using rspec's expectations with test/unit
* Moved rspec_on_rails up to the project root, simplifying the download url
* Fixed [#8103] RSpec not installing spec script correctly.
* The --spec option is replaced by the --example option.
* The --loadby option no longer supports a file argument. Use --example file_name instead.
* The --example option can now take a file name as an argument. The file should contain example names.
* Internal classes are named Behaviour/Example (rather than Context/Specification).
* You can now use mocha by saying config.mock_with :mocha in a spec_helper
* before_context_eval is replaced by before_eval.
* Applied [#9509] allow spaced options in spec.opts
* Applied [#9510] Added File for Ruby 1.8.6
* Applied [#9511] Clarification to README file in spec/
* Moved all of the Spec::Rails specs down to the plugins directory - now you can run the specs after you install.
* Updated RSpec.tmbundle to the 0.9 syntax and replaced context/specify with describe/it.
* Applied [#9232] ActionController::Base#render is sometimes protected (patch from Dan Manges)
* Added --reverse option, allowing contexts/specs to be run in reverse order.
* Added --loadby option, allowing better control over load order for spec files. mtime and file.txt supported.
* Implemented [#8696] --order option (see --reverse and --loadby)
* Added describe/it as aliases for context/specify - suggestion from Dan North.
* Applied [#7637] [PATCH] add skip-migration option to rspec_resource generator
* Added [#9167] string.should have_tag
* Changed script/rails_spec_server to script/spec_server and added script/spec (w/ path to vendor/plugins/rspec)
* Fixed [#8897] Error when mixing controller spec with/without integrated views and using template system other than rhtml
* Updated sample app specs to 0.9 syntax
* Updated generated specs to 0.9 syntax
* Applied [#8994] trunk: generated names for be_ specs (Multiple patches from Yurii Rashkovskii)
|