### 2.14.2 / 2013-08-14
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.1...v2.14.2)
Bug fixes
* Fix `be_<predicate>` matcher to not support operator chaining like the
`be` matcher does (e.g. `be == 5`). This led to some odd behaviors
since `be_<predicate> == anything` returned a `BeComparedTo` matcher
and was thus always truthy. This was a consequence of the implementation
(e.g. subclassing the basic `Be` matcher) and was not intended behavior.
(Myron Marston).
* Fix `change` matcher to compare using `==` in addition to `===`. This
is important for an expression like:
`expect {}.to change { a.class }.from(ClassA).to(ClassB)` because
`SomeClass === SomeClass` returns false. (Myron Marston)
### 2.14.1 / 2013-08-08
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0...2.14.1)
Bug fixes
* Ensure diff output uses the same encoding as the encoding of
the string being diff'd to prevent `Encoding::UndefinedConversionError`
errors (Jon Rowe).
### 2.14.0 / 2013-07-06
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.14.0.rc1...v2.14.0)
Bug fixes
* Values that are not matchers use `#inspect`, rather than `#description` for
documentation output (Andy Lindeman, Sam Phippen).
* Make `expect(a).to be_within(x).percent_of(y)` work with negative y
(Katsuhiko Nishimra).
* Make the `be_predicate` matcher work as expected used with `expect{...}.to
change...` (Sam Phippen).
### 2.14.0.rc1 / 2013-05-27
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.13.0...v2.14.0.rc1)
Enhancements
* Enhance `yield_control` so that you can specify an exact or relative
number of times: `expect { }.to yield_control.exactly(3).times`,
`expect { }.to yield_control.at_least(2).times`, etc (Bartek
Borkowski).
* Make the differ that is used when an expectation fails better handle arrays
by splitting each element of the array onto its own line. (Sam Phippen)
* Accept duck-typed strings that respond to `:to_str` as expectation messages.
(Toby Ovod-Everett)
Bug fixes
* Fix differ to not raise errors when dealing with differently-encoded
strings (Jon Rowe).
* Fix `expect(something).to be_within(x).percent_of(y)` where x and y are both
integers (Sam Phippen).
* Fix `have` matcher to handle the fact that on ruby 2.0,
`Enumerator#size` may return nil (Kenta Murata).
* Fix `expect { raise s }.to raise_error(s)` where s is an error instance
on ruby 2.0 (Sam Phippen).
* Fix `expect(object).to raise_error` passing. This now warns the user and
fails the spec (tomykaira).
Deprecations
* Deprecate `expect { }.not_to raise_error(SpecificErrorClass)` or
`expect { }.not_to raise_error("some specific message")`. Using
these was prone to hiding failures as they would allow _any other
error_ to pass. (Sam Phippen and David Chelimsky)
### 2.13.0 / 2013-02-23
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.1...v2.13.0)
Enhancements
* Add support for percent deltas to `be_within` matcher:
`expect(value).to be_within(10).percent_of(expected)`
(Myron Marston).
* Add support to `include` matcher to allow it to be given a list
of matchers as the expecteds to match against (Luke Redpath).
Bug fixes
* Fix `change` matcher so that it dups strings in order to handle
mutated strings (Myron Marston).
* Fix `should be =~ /some regex/` / `expect(...).to be =~ /some regex/`.
Previously, these either failed with a confusing `undefined method
matches?' for false:FalseClass` error or were no-ops that didn't
actually verify anything (Myron Marston).
* Add compatibility for diff-lcs 1.2 and relax the version
constraint (Peter Goldstein).
* Fix DSL-generated matchers to allow multiple instances of the
same matcher in the same example to have different description
and failure messages based on the expected value (Myron Marston).
* Prevent `undefined method #split for Array` error when dumping
the diff of an array of multiline strings (Myron Marston).
* Don't blow up when comparing strings that are in an encoding
that is not ASCII compatible (Myron Marston).
* Remove confusing "Check the implementation of #==" message
printed for empty diffs (Myron Marston).
### 2.12.1 / 2012-12-15
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.12.0...v2.12.1)
Bug fixes
* Improve the failure message for an expression like
`{}.should =~ {}`. (Myron Marston and Andy Lindeman)
* Provide a `match_regex` alias so that custom matchers
built using the matcher DSL can use it (since `match`
is a different method in that context).
(Steven Harman)
### 2.12.0 / 2012-11-12
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.3...2.12.0)
Enhancements
* Colorize diffs if the `--color` option is configured. (Alex Coplan)
* Include backtraces in unexpected errors handled by `raise_error`
matcher (Myron Marston)
* Print a warning when users accidentally pass a non-string argument
as an expectation message (Sam Phippen)
* `=~` and `match_array` matchers output a more useful error message when
the actual value is not an array (or an object that responds to `#to_ary`)
(Sam Phippen)
Bug fixes
* Fix `include` matcher so that `expect({}).to include(:a => nil)`
fails as it should (Sam Phippen).
* Fix `be_an_instance_of` matcher so that `Class#to_s` is used in the
description rather than `Class#inspect`, since some classes (like
`ActiveRecord::Base`) define a long, verbose `#inspect`.
(Tom Stuart)
### 2.11.3 / 2012-09-04
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.2...v2.11.3)
Bug fixes
* Fix (and deprecate) `expect { }.should` syntax so that it works even
though it was never a documented or intended syntax. It worked as a
consequence of the implementation of `expect` in RSpec 2.10 and
earlier. (Myron Marston)
* Ensure #== is defined on built in matchers so that they can be composed.
For example:
expect {
user.emailed!
}.to change { user.last_emailed_at }.to be_within(1.second).of(Time.zone.now)
### 2.11.2 / 2012-07-25
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
Bug fixes
* Define `should` and `should_not` on `Object` rather than `BasicObject`
on MacRuby. On MacRuby, `BasicObject` is defined but is not the root
of the object hierarchy. (Gabriel Gilder)
### 2.11.2 / 2012-07-25
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.1...v2.11.2)
Bug fixes
* Define `should` and `should_not` on `Object` rather than `BasicObject`
on MacRuby. On MacRuby, `BasicObject` is defined but is not the root
of the object hierarchy. (Gabriel Gilder)
### 2.11.1 / 2012-07-08
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.11.0...v2.11.1)
Bug fixes
* Constrain `actual` in `be_within` matcher to values that respond to `-` instead
of requiring a specific type.
* `Time`, for example, is a legit alternative.
### 2.11.0 / 2012-07-07
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.10.0...v2.11.0)
Enhancements
* Expand `expect` syntax so that it supports expections on bare values
in addition to blocks (Myron Marston).
* Add configuration options to control available expectation syntaxes
(Myron Marston):
* `RSpec.configuration.expect_with(:rspec) { |c| c.syntax = :expect }`
* `RSpec.configuration.expect_with(:rspec) { |c| c.syntax = :should }`
* `RSpec.configuration.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }`
* `RSpec.configuration.add_should_and_should_not_to Delegator`
Bug fixes
* Allow only `Numeric` values to be the "actual" in the `be_within` matcher.
This prevents confusing error messages. (Su Zhang @zhangsu)
* Define `should` and `should_not` on `BasicObject` rather than `Kernel`
on 1.9. This makes `should` and `should_not` work properly with
`BasicObject`-subclassed proxy objects like `Delegator`. (Myron
Marston)
### 2.9.1 / 2012-04-03
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.9.0...2.9.1)
Bug fixes
* Provide a helpful message if the diff between two objects is empty.
* Fix bug diffing single strings with multiline strings.
* Fix for error with using custom matchers inside other custom matchers
(mirasrael)
* Fix using execution context methods in nested DSL matchers (mirasrael)
### 2.9.0 / 2012-03-17
[full changelog](http://github.com/rspec/rspec-expectations/compare/v2.8.0...v2.9.0)
Enhancements
* Move built-in matcher classes to RSpec::Matchers::BuiltIn to reduce pollution
of RSpec::Matchers (which is included in every example).
* Autoload files with matcher classes to improve load time.
Bug fixes
* Align respond_to? and method_missing in DSL-defined matchers.
* Clear out user-defined instance variables between invocations of DSL-defined
matchers.
* Dup the instance of a DSL generated matcher so its state is not changed by
subsequent invocations.
* Treat expected args consistently across positive and negative expectations
(thanks to Ralf Kistner for the heads up)
2.8.0 / 2012-01-04
full changelog
Enhancements
* Better diff output for Hash (Philippe Creux)
* Eliminate Ruby warnings (Olek Janiszewski)
2.8.0.rc2 / 2011-12-19
full changelog
No changes for this release. Just releasing with the other rspec gems.
2.8.0.rc1 / 2011-11-06
full changelog
Enhancements
* Use classes for the built-in matchers (they're faster).
* Eliminate Ruby warnings (Matijs van Zuijlen)