Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
Commits on Mar 27, 2012
@myronmarston myronmarston Started working on yield matchers. 99456da
Commits on Mar 29, 2012
@myronmarston myronmarston Rename helper methods for yield matcher specs. eb9d327
Commits on Mar 30, 2012
@myronmarston myronmarston Match yielded args with == or ===.
Previously, this expectation failed:

  expect { |b| _yield_with_args(String, Fixnum, &b) }.to yield_with_args(String, Fixnum)

...because Class=== returns false when given itself.
72c5dae
@myronmarston myronmarston Provide better message for negative yield_with_args matcher failure. f3923dd
@myronmarston myronmarston Group the yield examples by matcher. 1b106c4
Commits on Mar 31, 2012
@myronmarston myronmarston Add yield_successive_args matcher. 23f5acb
@myronmarston myronmarston Fix typo: "yields", not "yeilds". 1897250
@myronmarston myronmarston Remove diffability from yield matchers for now.
I'm not sure it makes sense given that they don't match strictly but instead match using === or ==.
3c6a81e
@myronmarston myronmarston Fix yield matchers to handle instance_eval.
It's debatable if instance_eval'ing a block can be considered yielding, but it's important that we use local variables in the lambdas rather than instance variables, because we don't want to modify the state of the receiver of #instance_eval.
0e79594
@myronmarston myronmarston Raise an error if a yield matcher is used w/ an expect block that acc…
…epts no args.

The expect block must accept an arg, and pass it on to the method-under-test as a block, in order for these yield matchers to work properly.  Since this is atypical for an expect block, this error will help guide people when they use these matchers incorrectly.
66a2f01
@myronmarston myronmarston Add description to all yield matchers. e969284
Commits on Apr 01, 2012
@myronmarston myronmarston Add API docs for yield matchers.
Cukes are still to come.
b94da8d
Commits on Apr 02, 2012
@dchelimsky dchelimsky Change the be_within matcher to be inclusive of the delta.
- Fixes #131.
- This changes the way the matcher behaves, which is something we would
  generally avoid in anything but a major release, however we believe
  that this is the correct behavior and that this change is very unlikely
  to impact anybody negatively. Specifically:

  1. 17.4.should be_within(0.5).of(17) # used to pass and continues to pass
  2. 17.5.should be_within(0.5).of(17) # used to fail due to lack of inclusivity, but passes after this change
  3. 17.6.should be_within(0.5).of(17) # used to fail and continues to fail
  4. 17.4.should_not be_within(0.5).of(17) # used to fail and continues to fail
  5. 17.5.should_not be_within(0.5).of(17) # used to pass due to lack of inclusivity, but fails after this change
  6. 17.6.should_not be_within(0.5).of(17) # used to fail and continues to fail

  Scenario 2 used to fail, so it's unlikely to be present.
  Scenario 5 will result in new failures, but we believe that it is very unlikely to be used.
a9bf7ab
Commits on Apr 03, 2012
@dchelimsky dchelimsky bump to 2.9.1 f31ae96
@dchelimsky dchelimsky fix changelog 2cfed80
Commits on Apr 04, 2012
@dchelimsky dchelimsky need relish in the Gemfile to push relish docs 6fe2bca
@dchelimsky dchelimsky add doc files to .yardopts
[ci skip]
40cbc30
Commits on Apr 08, 2012
@jeremywadsack jeremywadsack Added start_with and end_with matchers for String 77a9ecc
@jeremywadsack jeremywadsack Added start_with and end_with support for Array 9b9946c
@jeremywadsack jeremywadsack Handle case when expected can't be indexed ab1d055
@jeremywadsack jeremywadsack Rdoc for new matchers d5fdf35
@jeremywadsack jeremywadsack Fix up whitespace 5f367d9
Commits on Apr 09, 2012
@dchelimsky dchelimsky Merge pull request #135 from jeremywadsack/start_with_end_with
Add matchers start_with end_with
05d9853
Commits on Apr 10, 2012
@myronmarston myronmarston Add cukes for yield matchers. 24335ee
@dchelimsky dchelimsky Change start_with and end_with matchers to take varargs.
- Clean up rdoc, features, and specs.
- Refactor the two matchers a bit.
- Add changelog.
- #135
2e0cdbc
@dchelimsky dchelimsky add start_with and end_with matchers to README [ci skip] 35d98aa
@myronmarston myronmarston Raise an error if expect block arg isn't passed on as a block.
Otherwise, the matcher is unable to detect anything about if the method-under-test yields, and the user may get false positives.
780655c
@myronmarston myronmarston Refactor yield matchers a bit.
This allows the YieldProbe to take care of defining the probe block, and simplifies the #matches? methods.
7a0e4bb
@myronmarston myronmarston Raise an error if a single-yield matcher is used with a multi-yield m…
…ethod.

Only the yield_successive_args matcher is designed for the multi-yield case.
f8c3c01
Commits on Apr 11, 2012
@myronmarston myronmarston Update the yield cukes with a few more/better examples. d020cfe
Commits on Apr 17, 2012
@jeremywadsack jeremywadsack Added more helpful message when actual has #[] but does not support #…
…[0,3]

Pull request #135
5908107
@dchelimsky dchelimsky align usage of expect/to 3591cd2
@dchelimsky dchelimsky can't use 1.9 hash syntax in specs (still support 1.8) - #135 5bdf4b8
Commits on Apr 19, 2012
@myronmarston myronmarston Merge pull request #129 from rspec/yield_matchers
Yield matchers
e610e40
@myronmarston myronmarston Update changelog.
[ci skip]
429c672
Commits on Apr 20, 2012
@dchelimsky dchelimsky match_unless_raises accepts multiple args
- in support of fix for rspec/rspec-rails#530
a5a58aa
@jfirebaugh jfirebaugh Do not require exception messages to exactly match MRI
Different Ruby implementations deserve latitude in the error
messages, e.g. to provide more precise diagnostics than MRI.

In particular, do not rely on the fact that RuntimeError generated
by MRI when calling bare `raise` without a current exception has
an empty message. That is not the case on Rubinius; it is arguably
a bug in MRI.

Following this commit, all test pass on Rubinius head.
9fa523e
Commits on Apr 21, 2012
@dchelimsky dchelimsky Merge pull request #140 from jfirebaugh/rubinius
Do not require exception messages to exactly match MRI
b98f0ba
@dchelimsky dchelimsky Fix potential false-positive so that it will fail correctly if there …
…is a regression.

- See #140.
694cbf1
@dchelimsky dchelimsky Changlog for #140 780d4c2
@dchelimsky dchelimsky eliminate 'not initialized' warning on @matcher_execution_context 7c76204
@dchelimsky dchelimsky ci: run against rbx 1fdaedb
@dchelimsky dchelimsky Fix Changelog formatting [ci skip] 20c7a3c
@dchelimsky dchelimsky Changelog [ci skip] f93ce4c
Commits on Apr 22, 2012
@dchelimsky dchelimsky shorten file extension f315020
@dchelimsky dchelimsky align config files across rspec projects fe40efd
@dchelimsky dchelimsky silence more warnings 5d8a233
@dchelimsky dchelimsky dev: align Gemfiles across rspec projects 15d96b8
Commits on May 01, 2012
@dchelimsky dchelimsky update yard to 0.8 97b5e0c
Commits on May 04, 2012
@dchelimsky dchelimsky update changelog for 2.10 release 77e1a09
@dchelimsky dchelimsky bump to 2.10.0 2e348ff
Commits on May 09, 2012
@myronmarston myronmarston Add support for `expect(value)` syntax.
Note: there's more to do here (documentation, etc); this is just a starting point for discussion and comments.
d279c3b
@myronmarston myronmarston Don't expose #target as a public API.
Also, fix the spelling of the class while I'm at it.
0d7ce9c
@myronmarston myronmarston Add configuration API for choosing an expectation syntax.
:should, :expect or both can be chosen.
d9ab1a3
@myronmarston myronmarston Don't redefine should or expect when re-configured. ad2a757
Commits on May 10, 2012
@myronmarston myronmarston Refactor enabling/disabling of expectation syntaxes.
* Fix build on JRuby. Our sandboxing via forking didn't work
  on JRuby since fork isn't available. On JRuby we just
  re-enable all syntaxes at the end of each sandboxed example.
* Testing this revealed that the way I was restoring a disabled
  syntax didn't always work. Based on the random order, sometimes
  spec/rspec/matchers/be_spec.rb:427 would fail with
  "TypeError: bind argument must be an instance of Kernel".
* Refactored main logic into new syntax module, that can add
  the syntaxes to any class or module. Kernel/RSpec::Matcher
  defaults are provided for convenience. This also fixes the
  bind failure, by redefining the methods anew rather than
  re-binding the old ones.
309c4f0
@myronmarston myronmarston Prevent operator matchers from new expect syntax. 6de81c7
Commits on May 11, 2012
@myronmarston myronmarston We can't count on hash ordering.
...so use an array of tuples instead.

Closes #144.
3cf9110
@myronmarston myronmarston Cleanup code a bit.
- Remove bang from method...as @justinko rightly pointed out, there's no corresponding bangless method so it didn't really follow convention here.
- Use an early guarded return.
8567ac6
Commits on May 12, 2012
@myronmarston myronmarston Add yard docs for new modules.
[ci skip]
f1b8aa2
@myronmarston myronmarston Add match_array matcher method for the old =~ array matcher.
This is needed because we've decided not to support operator matchers off of `expect(value).to`, and `match_array` is the best name we've come up with for it.
f00de57
Commits on May 13, 2012
@dchelimsky dchelimsky Remove obsolete spec
- it wasn't running because it was dynamically bound to classes that
  were no longer being found.
- it was specifying an age-old protocol that isn't used by
  rspec-expectations, so it would never be used.
5626043
Commits on May 17, 2012
@zhangsu zhangsu Fix confusing error message in `be_within`
This is a patch for the following issue:

#92

It is possible to have duck typing for numerical operations, but the minus
sign is often used for other operations as well such as the set
difference that Array#- performs. In that case, even if it does not fail
on the :- method, it will probably fail on the subsequent :abs and :<=
calls.
675115d
@justinko justinko Merge pull request #145 from zhangsu/master
Fix confusing error message in `be_within`
d186bf8
@justinko justinko Clearer error message for previous commit. d55d9a8
@justinko justinko Make "validation" methods for the be_within matcher class private. 1cac6bc
@justinko justinko changelog 605a520
Commits on May 21, 2012
@dchelimsky dchelimsky dev: update Guardfile to run everything when matchers change c450e3d
@dchelimsky dchelimsky refactor BeWithin to be more self-contained.
More explicit and consistent in dealing with instance variables rather
than relying on knowledge of how BaseMatcher handles them.
38b247a
@dchelimsky dchelimsky minor refactoring: use implicit return 123169e
Commits on May 22, 2012
@dchelimsky dchelimsky dev: --backtrace 4c4c8dc
@dchelimsky dchelimsky refactor built-in matchers
Removed default initialize and matches? from the BaseMatcher and added
explicit initialization where needed.
a465f14
@dchelimsky dchelimsky Fix some cukes broken by the previous matcher refactoring (messages c…
…hanged)
b396938
@myronmarston myronmarston Merge pull request #119 from rspec/expect_syntax
Add support for `expect(value)` syntax.
71a2c8d
@myronmarston myronmarston Update changelog. f9574db
@myronmarston myronmarston More changelog updates. 9793323
Commits on May 25, 2012
@brynary brynary Add Code Climate badge 99fb8ce
@dchelimsky dchelimsky Merge pull request #146 from brynary/codeclimate-badge
Add Code Climate badge
089aca4
Commits on Jun 05, 2012
@myronmarston myronmarston Add more docs on syntax configuration.
Closes #149.
5dd161e
Commits on Jun 07, 2012
@justinko justinko Use `eq` instead of `==` for built-in matcher failure message. 43526ec
Commits on Jun 14, 2012
@dchelimsky dchelimsky put the rdoc for should, should_not, and expect where yard can pick i…
…t up
7847016
Commits on Jun 15, 2012
@myronmarston myronmarston Add `should` and `should_not` to BasicObject on 1.9.
For #114.
4325717
@myronmarston myronmarston Add #add_should_and_should_not to configuration API.
This allows users to manually add these methods to proxy objects that do not have them.

Closes #114.
a954586
@myronmarston myronmarston Update changelog.
[ci skip]
6a8c932
Commits on Jun 20, 2012
@dchelimsky dchelimsky refactor matchers to use BaseMatcher's initialize and matches? methods 4024344
Commits on Jun 23, 2012
@dchelimsky dchelimsky Change BaseMatcher to a class.
It was a module, but it was really acting as a base class (it was even
in the name).

Very slightly more efficient (see benchmarks/include_v_superclass.rb)
49dc451
Commits on Jun 25, 2012
@dchelimsky dchelimsky ensure the eq matcher sends :== to actual (not expected) a3e2839
Commits on Jul 07, 2012
@dchelimsky dchelimsky add travis badge to README adaaa9b
@dchelimsky dchelimsky space, the final frontier b394f47
@dchelimsky dchelimsky bump to 2.11.0 45161a7
@dchelimsky dchelimsky improve automation for publishing to relishapp.com 705ddc5
Commits on Jul 08, 2012
@dchelimsky dchelimsky Constrain `actual` in `be_within` matcher to values that respond to `-`
instead of requiring a specific type.

- `Time`, for example, is a legit alternative.
- Fixes issue introduced by #145
1d2cc1f
@dchelimsky dchelimsky changelog for 2.11.1 release c6da0f6
@dchelimsky dchelimsky loosen time constraint for be_within example 79febad
Commits on Jul 10, 2012
@dchelimsky dchelimsky enhance rdoc for expect syntax ebd8a4c
@dchelimsky dchelimsky tweak README (expect syntax) d5417f9
Commits on Jul 13, 2012
@myronmarston myronmarston Remove the hacky search for should_not in backtrace.
It wasn't working for the `expect { .. }.to` syntax, anyway.
9814ab2
@myronmarston myronmarston Loosen error message constraints for raise_error matcher specs.
This is in prep for #59--once I had some backtrace info, all of these would fail since they are doing exact string matches.
2c2fdb6
Commits on Jul 17, 2012
@alexcoplan alexcoplan add support for coloured diffs dbe5aa3
@alexcoplan alexcoplan fixed coloring, added tests for colored diff 54b9e98
@alexcoplan alexcoplan tests now stub color config, removed setter in config 505db9f
@alexcoplan alexcoplan no magic nums, yellow->green for insertions 477fac1
@alexcoplan alexcoplan fixed chr grabbing for older rb implementations 83cdba4
Commits on Jul 18, 2012
@myronmarston myronmarston Merge pull request #157 from alexcoplan/color_diffs
Colored Diffs
3b4f60c
@myronmarston myronmarston Update changelog. 067f13d
Commits on Jul 19, 2012
@dchelimsky dchelimsky move post-2.11.1 enhancements in changelog 024002c
Commits on Jul 25, 2012
@ggilder ggilder #159: Revise should(_not) to work with MacRuby 9c9619b
@myronmarston myronmarston Merge pull request #160 from ggilder/master
#159: Revise should(_not) to work with MacRuby
d51bf72
@myronmarston myronmarston Add change log entry for #160. 147f710
@alindeman alindeman Be defensive about resolving `Object`
It'd be pretty crazy for there to be an `RSpec::Object` or
`RSpec::Expectations::Object,` but 1) Ruby's constant resolution rules
have changed and I don't always remember them and 2) We were originally
defensive about it.
3cacdde
Commits on Jul 26, 2012
@myronmarston myronmarston Cherry-pick 2.11.2 release stuff from 2-11-maint branch. c897a47
Commits on Jul 27, 2012
@myronmarston myronmarston Ensure #== is defined on build in matchers so that they can be composed.
For example:

expect {
  user.emailed!
}.to change{user.last_emailed_at}.from(nil).to be_within(1.second).of(Time.zone.now)

Closes #161.
d427bac
Commits on Aug 25, 2012
@alexcoplan alexcoplan use same color config method as core 94fce05
@alexcoplan alexcoplan improve diff coloring code 248004e
@alexcoplan alexcoplan revert to using static color methods 7cdd88b
@myronmarston myronmarston Merge pull request #169 from alexcoplan/better_diff_coloring
Better diff coloring
f4d4cd0
Commits on Aug 26, 2012
@myronmarston myronmarston Run all specs together and in isolation for build.
We want them to be able to pass when run in isolation w/o bundler being loaded.
b0d5007
@myronmarston myronmarston Fix ruby warnings.
/Users/myron/code/rspec-dev/repos/rspec-expectations/lib/rspec/matchers/dsl.rb:8: warning: method redefined; discarding old ignore
/Users/myron/code/rspec-dev/repos/rspec-expectations/lib/rspec/matchers/dsl.rb:8: warning: previous definition of ignore was here
a8d9014
@myronmarston myronmarston Improve how we find the path to the rspec exe.
On travis, it found `/home/travis/builds/rspec/exe/rspec`,
and that didn't exist. I'm not sure why it didn't find the
one in rspec-core, but I think this'll fix it.
cafef45
@myronmarston myronmarston Revert recent build change -- it's not working on Travis CI.
I need to head to bed in a bit and I don't want to leave the build
broken. I'll put this in a branch and play with it there to
get it to work.

- Revert "Improve how we find the path to the rspec exe."
  This reverts commit cafef45.
- Revert "Run all specs together and in isolation for build."
  This reverts commit b0d5007.
aa4530d
Commits on Sep 05, 2012
@myronmarston myronmarston Fix and deprecate `expect { }.should` syntax.
Fixes #170.
b89b8c5
@myronmarston myronmarston Add missing changelog entry I forgot to add.
This was fixed in d427bac.
016aece
@myronmarston myronmarston Add 2.11.3 release info. cf6cf5d
Commits on Sep 06, 2012
@myronmarston myronmarston Fix full changelog URL. d5e6e36
Commits on Sep 08, 2012
@dchelimsky dchelimsky run should_clean gem (it "does ... v it "should ...) 3c0e7ea
Commits on Sep 10, 2012
@myronmarston myronmarston Fix and re-enable the test_all build.
I had previously attempted to add this in b0d5007 but find_path_to_rspec_exe wasn't quite right.

Travis installs rspec-core as a :git gem so the path is `.../rspec-core-<sha>/lib`, not `.../rspec-core/lib`.
46d5347
@myronmarston myronmarston Use stub_const rather than hand-rolled const mutation.
This also fixes a warning I was getting on the 1.8.7 build:

rspec-expectations/spec/rspec/matchers/have_spec.rb:13: warning: redefine pluralize
d0773b1
Commits on Sep 12, 2012
David Chelimsky whitespace 60a58ec
David Chelimsky update Gemfile-custom 66ad37c
David Chelimsky more custom Gemfile updates d3d8672
Commits on Sep 27, 2012
@samphippen samphippen Make the include matcher require the key to exist in the hash.
There was a weird case where {}.should include(:something => nil) would
pass, Myron suggested we make this not the case. Here's a patch that
does that

Signed-off-by: Sam Phippen <samphippen@googlemail.com>
04eb38d
@myronmarston myronmarston Fix typo. cfaf6b5
Commits on Oct 01, 2012
@myronmarston myronmarston Allow rbx-19mode build to fail (for now).
We've been getting a strange failure on rbx-19 that I can't reproduce locally:

https://travis-ci.org/#!/rspec/rspec-expectations/jobs/2583529
8c7cc53
@alindeman alindeman Tests specifically for ability to use ::RSpec.configuration, not ::RS…
…pec::Core

* It is possible for RSpec::Core to be defined, but not be fully loaded
  enough for RSpec.configuration to be accessible because
  rspec-core.gemspec requires 'lib/rspec/core/version' which defines
  RSpec::Core::Version but nothing else.
e20978f
Commits on Oct 03, 2012
@alindeman alindeman Document inline code samples with backticks
* Hopefully prevents relishapp from considering the _ as italics
4c0dfd7
Commits on Oct 04, 2012
@alindeman alindeman Fixes the build on rbx
* rbx confusingly raises a NoMethodError in the error case described in
  `access_running_example.feature`. MRI and JRuby raise NameError.
  Because matching exactly isn't super-important, let's just match less
  stringently on the error message.
32a1feb
@myronmarston myronmarston Fixup documentation output of configuration specs. 1644904
Commits on Oct 09, 2012
@myronmarston myronmarston Include backtrace in errors reported by `raise_error` matcher.
It's hard to troubleshoot unexpected errors when the backtrace is silenced,
as it was previously.

Closes #59.
4a919ab
@myronmarston myronmarston Merge pull request #177 from rspec/issue_59
Include backtrace in errors reported by `raise_error` matcher.
16a133f
@myronmarston myronmarston Allow rbx builds to fail.
    
We're getting weird sudden regressions on rbx, and given the frequency of
RBX updates (and recent experience with failing rbx bulids in VCR and other
rspec repos), I think it's due to a bug in rbx.
2f1595f
Commits on Oct 12, 2012
@vanstee vanstee Identify ruby code for syntax highlighting
Fixes #178
733e5d8
@alindeman alindeman Merge pull request #180 from vanstee/ruby_file_doc_strings
Identify ruby code for syntax highlighting
5bb512a
Commits on Oct 13, 2012
@myronmarston myronmarston Rbx builds are passing now thanks to @alindeman.
rspec/rspec-core@96e3d13
rspec/rspec-core@582a0a8

Revert "Allow rbx builds to fail."

This reverts commit 2f1595f.
e4eee95
Commits on Oct 16, 2012
@alindeman alindeman Build on JRuby --1.9 32799c0
@alindeman alindeman Scopes documentation gems and avoids installing them on Travis f4e53a9
@dchelimsky dchelimsky README - recommend eq over == 13d69c3
@alindeman alindeman JRuby --1.9 is green c8ddb5e
Commits on Oct 17, 2012
@samphippen samphippen Warn if the "message" param passed to a should is not a string 518a0f7
@myronmarston myronmarston It's a warning, not an error. 0e706c6
@myronmarston myronmarston Improve wording of warning. a6365b0
@myronmarston myronmarston Cleanup whitespace. cd196c5
@myronmarston myronmarston Update changelog. f4f2a29
Commits on Oct 21, 2012
@myronmarston myronmarston Use `hide_const` at a place where we really just want to hide a const…
…ant.
f88feba
Commits on Oct 23, 2012
@myronmarston myronmarston Cleanup whitespace. e2ef482
@rentalcustard rentalcustard Fix generated docstring when Class#inspect changed a5eb047
@rentalcustard rentalcustard Remove some unnecessary test code 2a39025
@rentalcustard rentalcustard Don't leak a class out of the spec 275d585
Commits on Oct 26, 2012
@rentalcustard rentalcustard Use stub_const to have a user class and show intent fffa5d5
@rentalcustard rentalcustard Remove no-longer-relevant comment 071710a
Commits on Oct 27, 2012
@samphippen samphippen Make the error message more useful when using match_array
* Now the error message will let you know if you're trying to match an
  array against something that isn't an array-like thing.
* Closes #186
* Fixes #185
e2a9e3f
@myronmarston myronmarston Merge pull request #184 from mortice/implicit-docstring-for-instance-…
…of-matcher

Fix generated docstring for BeAnInstanceOf when Class#inspect changed
d5d073e
@myronmarston myronmarston Update changelog.
[ci skip]
83d9cd2
Commits on Nov 09, 2012
@nanocity nanocity Use 'empty?' instead of 'any?' and 'none?' in order to match 'nil' an…
…d 'false' as argument values
3d9ae80
@alindeman alindeman Merge pull request #187 from nanocity/yield_arguments
Use 'empty?' instead of 'any?' and 'none?' to match 'nil' and 'false'
f8a8065
Commits on Nov 13, 2012
@dchelimsky dchelimsky prep for 2.12 [ci-skip] d353e8b
@alindeman alindeman Updates to rake 10 c780529
@dchelimsky dchelimsky bump version to 2.12 ef6882e
@alindeman alindeman Fixes changes link 5baacca
Commits on Dec 04, 2012
@alindeman alindeman OperatorMatcher considers ancestor chain
* Related #191
e5e5a74
Commits on Dec 05, 2012
@myronmarston myronmarston Merge pull request #192 from alindeman/operator_registry_considers_an…
…cestors

OperatorMatcher considers ancestor chain
abefb76
Commits on Dec 06, 2012
@myronmarston myronmarston Provide a clear failure message when using `{}.should =~ {}`.
The match_array matcher (delegated to by `=~` for enumerables) is
not meant to be used for hashes, but the `should =~` syntax doesn't
make that obvious. Previously, you would get a failure like:

     Failure/Error: actual.should =~ actual
       expected: {:foo=>"bar"}
            got: {:foo=>"bar"} (using =~)

...which is pretty confusing. Our `match_array` matcher already
includes handling for invalid arguments (such as hashes) to return
a clear failure message, but it wasn't being used for an expression
like `{}.should =~ {}` because it was only registered as an operator
matcher for `Array`. This changes it so that it is registered as an
operator matcher for any Enumerable. This improves the failure message
for enumerable types like hash and set, but on its own, it could cause
breakage for things like 1.8 strings that are Enumerable but also
define a reasonable `=~`.  The fix here changes the operator matcher
delegation logic so that it only delegates to the registered matcher
if the object has the generic Kernel implementation of the operator.
If it has a more specific implementation, we assume the user actually
wants to match using the given operator itself.

Fixes #191.
c7a91af
@myronmarston myronmarston Merge pull request #193 from rspec/hash_match_array_failure
Provide a clear failure message when using `{}.should =~ {}`.
cf52fe6
@stevenharman stevenharman Cleanup whitespace b36e3ca
@stevenharman stevenharman Allow custom matchers to use #match built in
Addresses problem with dispatching the #match matcher from within a
custom matcher. (Wow... what a mouthful) See Issue #188.
6442118
@stevenharman stevenharman Add explaination about why we alias #match c956506
Commits on Dec 07, 2012
@myronmarston myronmarston Merge pull request #194 from stevenharman/issue_188_custom_matchers_w…
…ith_match

Allow custom matchers to use built-in #match
7fe9ec4
Commits on Dec 16, 2012
@myronmarston myronmarston Run travis builds against ruby 2.0. 2e14988
@myronmarston myronmarston 2.12.1 release. a71fe2f
Commits on Dec 19, 2012
@myronmarston myronmarston Improve the way we run builds.
- No need for `find_path_to_rspec_exe`; I've discovered that `--standalone`
  and `--binstubs` together produce bins that don't load bundler.
- Add `-x` to `set -e` as that will cause the script to print each command
  as it runs.  No need for `print_and_run`.
- Add cucumber to test_all script, and use just that for the build.
6c14484
Commits on Dec 26, 2012
@myronmarston myronmarston No need to use send here. fa82098
Commits on Dec 31, 2012
@soulcutter soulcutter Fixed some issues with intra-word italics in markdown fabc67c
@soulcutter soulcutter Normalized a lot of documentation to use markdown ruby blocks to fix …
…some display irregularities
0022041
@soulcutter soulcutter Fixed gherkin LexingError 9f36e2a
Commits on Jan 01, 2013
@soulcutter soulcutter Changed incorrect triple-quote ruby markdown blocks to correct triple…
… backticks
3e2cfe0
Commits on Jan 02, 2013
@soulcutter soulcutter Missed a couple incorrect triple quote ruby markdown blocks 8ef6914
@myronmarston myronmarston Merge pull request #195 from soulcutter/docs-normalization
Documentation fixes for markdown intra-word italics and adding ruby markdown blocks
e102336
@myronmarston myronmarston Ignore .rspec-local.
It's for personal dev preferences.
4db6234
Commits on Jan 04, 2013
@myronmarston myronmarston Cleanup whitespace. 13967c1
@myronmarston myronmarston Add missing require. b92e243
@myronmarston myronmarston Switch to new expect syntax.
This was a bit more difficult than for rspec-core and
rspec-mocks, since we still need to test the old
`should` syntax. I've defined a shared_context, available
by tagging a group with `:uses_should`, that makes `should`
temporarily available to examples in that group.
72050db
@myronmarston myronmarston Remove unnecessary spec_helper requires.
These cuke scenarios don't create a spec_helper file.
Instead, the `spec/spec_helper` file (used by rspec-expectations'
specs, but not intended for use by the cukes) was being loaded.
It was causing failures because it disables `should` but I hadn't
gone through the cukes yet.
649d450
Commits on Jan 08, 2013
@alindeman alindeman Merge pull request #196 from rspec/switch_to_new_expect_syntax
Switch to new expect syntax.
c09b889
@myronmarston myronmarston Cleanup whitespace. 5e9817e
@myronmarston myronmarston Fix change matcher to handle mutated strings.
Fixes #41.
a029d78
@myronmarston myronmarston No need for this load path management. 06a84fe
Commits on Jan 09, 2013
@myronmarston myronmarston Rework be_within specs.
The old specs were incomplete and were poorly
expressed (focusing on internal APIs like #matches?),
rather than focusing just on the way end users use
the matcher.
25a1ed8
@myronmarston myronmarston Add percent support to be_within matcher.
Fixes #189.
73afd3a
@myronmarston myronmarston Rework a couple more be_within specs. f12659e
Commits on Jan 14, 2013
@myronmarston myronmarston Fix `should be =~` matcher.
It looks like it never actually worked since the be matcher
didn't define a `=~` operator previously.

Fixes #199.
5d1473a
@myronmarston myronmarston Favor `__send__` over `send`.
It's safer, to guard against cases like `Socket#send`
or `Message#send` where `send` does not do the normal
ruby thing.
eed8417
Commits on Jan 15, 2013
@myronmarston myronmarston Fix messaging so that the `expect` syntax is used if it is enabled.
Fixes #197.
04ff16b
@myronmarston myronmarston Fix config syntax sandbox on jRuby. b468a19
Commits on Jan 22, 2013
@petergoldstein petergoldstein Add support for diff-lcs 1.2.x while maintaining backwards compatibil…
…ity with diff-lcs 1.1.3. Updated gemspec to support either as a runtime dependency.
feba881
@myronmarston myronmarston Merge pull request #200 from enthuseinc/feature/support_diff-lcs_1.2.x
Add support for diff-lcs 1.2.x while maintaining backwards compatibility with 1.1.3
3d6fc82
@myronmarston myronmarston Update Changelog.
[ci skip]
723750f
Commits on Feb 03, 2013
@myronmarston myronmarston Fix fail_with so it handles strings in any encoding.
Previously we would get an Encoding::CompatibilityError if
an encoding was used that's not ASCII compatible.

Fixes #201.
a46e7aa
Commits on Feb 04, 2013
@myronmarston myronmarston Remove confusing empty diff message.
The existing message made assumptions (e.g. that `==` was used for comparison)
there were not always true, causing confusion.

Fixes #143.
b9ba2f2
Commits on Feb 06, 2013
@myronmarston myronmarston Merge pull request #203 from rspec/remove_confusing_message
Remove confusing empty diff message.
569219c
Commits on Feb 07, 2013
@myronmarston myronmarston Fix caching bugs in DSL matchers.
Previously, `@messages` was not cleared when new instances
were created, so the `description`, `failure_message_for_should`
and `failure_message_for_should_not` blocks would take on the
value set by the most recently built instance.

In a case like:

RSpec::Matchers.define(:be_like_a) do |expected|
  description { "be like a #{expected}" }
end

be_like_a_moose = be_like_a("moose")
be_like_a_horse = be_like_a("horse")

...each matcher instance eval'd the `define` block once.
Since the object that holds a reference to the description
block (the `@messages` instance variable) was not cleared
between the two examples, the description block for both
instances would have `expected` bound to "horse" (since
it was instantiated last, and its define block eval'd last).

This caused the description and failure messages to return
the wrong values in situations like these.
fc4b66d
Commits on Feb 09, 2013
@halostatue halostatue Limit diff-lcs to 1.x series only
I have some experimental code that I am working with that may change the
Diff::LCS interface in version 2.0 (whenever that drops). I would like
to encourage the adoption of the (currently bug-free) 1.2 release as
much as possible, but I don't want to cause other problems if the future
release changes.
8fb7fff
@alindeman alindeman Merge pull request #204 from halostatue/patch-1
Limit diff-lcs to 1.x series only
3b3f4db
@alindeman alindeman Corrects syntax of gemspec 875ecbe
Commits on Feb 10, 2013
@myronmarston myronmarston Skip redcarpet on JRuby since it has native components. 2852f9a
@myronmarston myronmarston Try to fix the build by no longer requiring test/unit.
Our travis builds have started failing with:

/home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/test/unit.rb:49:in `process_args': invalid option: --format (OptionParser::InvalidOption)
	from /home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
	from /home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
	from /home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/test/unit.rb:21:in `run'
	from /home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
	from /home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
	from /home/travis/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'

...so we no longer want to require `test/unit` in spec_helper.rb.  However, there are 3 examples that are specifically testing integration with test/unit (for folks who use rspec-expectations w/ it). My attempted solution is to sandbox the require of test/unit in a subprocess that exits with `exit!` to skip test/unit's `at_exit` hook.
8884008
@myronmarston myronmarston The ruby 2.0 build is green on travis. a6df90b
@lukeredpath lukeredpath Written a failing feature to describe how fuzzy collection matching w…
…orks.
35d2843
@lukeredpath lukeredpath Should be able to do fuzzy matching against arrays using include?(som…
…e_matcher) or include?(array_of_matchers).

I've deliberately only implemented fuzzy matching support for arrays right now, it might make sense
to extend support to hashes though.
1f9ee32
@lukeredpath lukeredpath Slight tweak to the cucumber feature to get it passing. d372990
@lukeredpath lukeredpath Favour duck-type checks over class checks 69c17d5
@lukeredpath lukeredpath Started to add some integration specs to show the interaction between…
… include()

matcher support and the built-in matchers.
24cef01
@lukeredpath lukeredpath It helps to use the matcher you are testing 8ec3b51
@myronmarston myronmarston Switch to new expect syntax. bd6b6b7
@myronmarston myronmarston Cleanup whitespace. 806dac8
@myronmarston myronmarston When composing matchers with `include` it should not be diffable.
Otherwise, we get ridiculous output like:

     Failure/Error: expect(['foo', 'bar', 'baz']).to include(string_containing_string("abc"))
       expected ["foo", "bar", "baz"] to include a string containing 'abc'
       Diff:
       @@ -1,30 +1,2 @@
       -[#<RSpec::Matchers::DSL::Matcher:0x007fb244f536f8
       -  @actual="baz",
       -  @declarations=
       -   #<Proc:0x007fb244c1a5e0@/Users/myron/code/rspec-dev/repos/rspec-expectations/spec/rspec/matchers/include_spec.rb:390>,
       -  @diffable=false,
       -  @expected=["abc"],
       -  @expected_exception=nil,
       -  @match_block=
       -   #<Proc:0x007fb244f52b18@/Users/myron/code/rspec-dev/repos/rspec-expectations/spec/rspec/matchers/include_spec.rb:391>,
       -  @match_for_should_not_block=nil,
       -  @matcher_execution_context=
       -   #<RSpec::Core::ExampleGroup::Nested_89::Nested_1:0x007fb244f53dd8
       -    @example=
       -     #<RSpec::Core::Example:0x007fb244c378e8
       -      @around_each_hooks=nil,
       -      @example_block=nil,
       -      @example_group_class=nil,
       -      @example_group_instance=nil,
       -      @exception=nil,
       -      @metadata=nil,
       -      @options=nil,
       -      @pending_declared_in_example=nil>,
       -    @matcher_execution_context=
       -     #<RSpec::Core::ExampleGroup::Nested_89::Nested_1:0x007fb244f53dd8 ...>>,
       -  @messages=
       -   {:description=>
       -     #<Proc:0x007fb244f52af0@/Users/myron/code/rspec-dev/repos/rspec-expectations/spec/rspec/matchers/include_spec.rb:395>},
       -  @name=:string_containing_string,
       -  @rescued_exception=nil>]
       +["foo", "bar", "baz"]
7ecd28a
@myronmarston myronmarston Shorten verbose matcher name.
string_containing_string => a_string_containing
e3ef34b
@myronmarston myronmarston Add specs for `expect().not_to include(matcher, matcher)`. cefa32c
@myronmarston myronmarston Add changelog entry for #85. 07a064a
Commits on Feb 13, 2013
@pjambet pjambet Use new Codeclimate badge, made by @olivierlacan 1960040
@myronmarston myronmarston Merge pull request #209 from pjambet/use_new_codeclimate_shield
Use new Codeclimate badge, made by @olivierlacan
b2a6efd
Commits on Feb 16, 2013
@myronmarston myronmarston Fix `include` matcher so that its matcher-detection logic is more rob…
…ust.

- Don't treat an object that responds to everything (such as a null object
  double) as a matcher.
- Don't treat an object that responds to #matches? but not other parts of
  the matcher protocol as a matcher. `#matches?` is a common enough method
  name that it's easy to imagine domain objects that define this method
  but are not intended to be used as rspec matchers.
- Ensure both old and new style matchers work.  It used to be `failure_message`
  but changed at some point to `failure_message_for_should`.

Fixes #211.
5fbe94a
Commits on Feb 17, 2013
@myronmarston myronmarston rbx-18 is failing with strange errors on travis.
Missing or uninitialized constant: RbConfig (NameError)

I don't have the energy to fight with it now :(.
9ec34f9
Commits on Feb 18, 2013
@myronmarston myronmarston Prevent `undefined method #split for Array` error. 5d3d228
Commits on Feb 23, 2013
@myronmarston myronmarston Add missing changelog entries.
[ci skip]
d33ea78
@myronmarston myronmarston Put enhancements first to highlight them.
[ci skip]
e2d498d
@myronmarston myronmarston Update changelog for release 4affaee
@myronmarston myronmarston 2.13.0 release ffeb26a