Skip to content
This repository
  • 94 commits
  • 60 files changed
  • 21 comments
  • 7 contributors
Mar 26, 2012
Myron Marston myronmarston Started working on yield matchers. 99456da
Mar 28, 2012
Myron Marston myronmarston Rename helper methods for yield matcher specs. eb9d327
Mar 29, 2012
Myron Marston 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
Myron Marston myronmarston Provide better message for negative yield_with_args matcher failure. f3923dd
Myron Marston myronmarston Group the yield examples by matcher. 1b106c4
Mar 30, 2012
Myron Marston myronmarston Add yield_successive_args matcher. 23f5acb
Myron Marston myronmarston Fix typo: "yields", not "yeilds". 1897250
Myron Marston 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
Myron Marston 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
Myron Marston 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
Mar 31, 2012
Myron Marston myronmarston Add description to all yield matchers. e969284
Myron Marston myronmarston Add API docs for yield matchers.
Cukes are still to come.
b94da8d
Apr 02, 2012
David Chelimsky 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
Apr 03, 2012
David Chelimsky dchelimsky bump to 2.9.1 f31ae96
David Chelimsky dchelimsky fix changelog 2cfed80
Apr 04, 2012
David Chelimsky dchelimsky need relish in the Gemfile to push relish docs 6fe2bca
David Chelimsky dchelimsky add doc files to .yardopts
[ci skip]
40cbc30
Apr 08, 2012
Jeremy Wadsack jeremywadsack Added start_with and end_with matchers for String 77a9ecc
Jeremy Wadsack jeremywadsack Added start_with and end_with support for Array 9b9946c
Jeremy Wadsack jeremywadsack Handle case when expected can't be indexed ab1d055
Jeremy Wadsack jeremywadsack Rdoc for new matchers d5fdf35
Jeremy Wadsack jeremywadsack Fix up whitespace 5f367d9
David Chelimsky dchelimsky Merge pull request #135 from jeremywadsack/start_with_end_with
Add matchers start_with end_with
05d9853
Apr 09, 2012
Myron Marston myronmarston Add cukes for yield matchers. 24335ee
David Chelimsky 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
David Chelimsky dchelimsky add start_with and end_with matchers to README [ci skip] 35d98aa
Apr 10, 2012
Myron Marston 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
Myron Marston myronmarston Refactor yield matchers a bit.
This allows the YieldProbe to take care of defining the probe block, and simplifies the #matches? methods.
7a0e4bb
Myron Marston 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
Apr 11, 2012
Myron Marston myronmarston Update the yield cukes with a few more/better examples. d020cfe
Apr 17, 2012
Jeremy Wadsack jeremywadsack Added more helpful message when actual has #[] but does not support #…
…[0,3]

Pull request #135
5908107
David Chelimsky dchelimsky align usage of expect/to 3591cd2
David Chelimsky dchelimsky can't use 1.9 hash syntax in specs (still support 1.8) - #135 5bdf4b8
Apr 18, 2012
Myron Marston myronmarston Merge pull request #129 from rspec/yield_matchers
Yield matchers
e610e40
Myron Marston myronmarston Update changelog.
[ci skip]
429c672
Apr 19, 2012
David Chelimsky dchelimsky match_unless_raises accepts multiple args
- in support of fix for rspec/rspec-rails#530
a5a58aa
John Firebaugh 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
Apr 21, 2012
David Chelimsky dchelimsky Merge pull request #140 from jfirebaugh/rubinius
Do not require exception messages to exactly match MRI
b98f0ba
David Chelimsky dchelimsky Fix potential false-positive so that it will fail correctly if there …
…is a regression.

- See #140.
694cbf1
David Chelimsky dchelimsky Changlog for #140 780d4c2
David Chelimsky dchelimsky eliminate 'not initialized' warning on @matcher_execution_context 7c76204
David Chelimsky dchelimsky ci: run against rbx 1fdaedb
David Chelimsky dchelimsky Fix Changelog formatting [ci skip] 20c7a3c
David Chelimsky dchelimsky Changelog [ci skip] f93ce4c
Apr 22, 2012
David Chelimsky dchelimsky shorten file extension f315020
David Chelimsky dchelimsky align config files across rspec projects fe40efd
David Chelimsky dchelimsky silence more warnings 5d8a233
David Chelimsky dchelimsky dev: align Gemfiles across rspec projects 15d96b8
Apr 30, 2012
David Chelimsky dchelimsky update yard to 0.8 97b5e0c
May 03, 2012
David Chelimsky dchelimsky update changelog for 2.10 release 77e1a09
David Chelimsky dchelimsky bump to 2.10.0 2e348ff
May 08, 2012
Myron Marston 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
Myron Marston myronmarston Don't expose #target as a public API.
Also, fix the spelling of the class while I'm at it.
0d7ce9c
Myron Marston myronmarston Add configuration API for choosing an expectation syntax.
:should, :expect or both can be chosen.
d9ab1a3
Myron Marston myronmarston Don't redefine should or expect when re-configured. ad2a757
May 09, 2012
Myron Marston 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
Myron Marston myronmarston Prevent operator matchers from new expect syntax. 6de81c7
May 10, 2012
Myron Marston myronmarston We can't count on hash ordering.
...so use an array of tuples instead.

Closes #144.
3cf9110
May 11, 2012
Myron Marston 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
Myron Marston myronmarston Add yard docs for new modules.
[ci skip]
f1b8aa2
Myron Marston 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
May 13, 2012
David Chelimsky 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
May 16, 2012
Su Zhang (張甦) 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
Justin Ko justinko Merge pull request #145 from zhangsu/master
Fix confusing error message in `be_within`
d186bf8
May 17, 2012
Justin Ko justinko Clearer error message for previous commit. d55d9a8
Justin Ko justinko Make "validation" methods for the be_within matcher class private. 1cac6bc
Justin Ko justinko changelog 605a520
May 21, 2012
David Chelimsky dchelimsky dev: update Guardfile to run everything when matchers change c450e3d
David Chelimsky 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
David Chelimsky dchelimsky minor refactoring: use implicit return 123169e
David Chelimsky dchelimsky dev: --backtrace 4c4c8dc
David Chelimsky dchelimsky refactor built-in matchers
Removed default initialize and matches? from the BaseMatcher and added
explicit initialization where needed.
a465f14
David Chelimsky dchelimsky Fix some cukes broken by the previous matcher refactoring (messages c…
…hanged)
b396938
Myron Marston myronmarston Merge pull request #119 from rspec/expect_syntax
Add support for `expect(value)` syntax.
71a2c8d
Myron Marston myronmarston Update changelog. f9574db
Myron Marston myronmarston More changelog updates. 9793323
May 25, 2012
Bryan Helmkamp brynary Add Code Climate badge 99fb8ce
David Chelimsky dchelimsky Merge pull request #146 from brynary/codeclimate-badge
Add Code Climate badge
089aca4
Jun 04, 2012
Myron Marston myronmarston Add more docs on syntax configuration.
Closes #149.
5dd161e
Jun 06, 2012
Justin Ko justinko Use `eq` instead of `==` for built-in matcher failure message. 43526ec
Jun 13, 2012
David Chelimsky dchelimsky put the rdoc for should, should_not, and expect where yard can pick i…
…t up
7847016
Jun 14, 2012
Myron Marston myronmarston Add `should` and `should_not` to BasicObject on 1.9.
For #114.
4325717
Myron Marston 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
Myron Marston myronmarston Update changelog.
[ci skip]
6a8c932
Jun 19, 2012
David Chelimsky dchelimsky refactor matchers to use BaseMatcher's initialize and matches? methods 4024344
Jun 23, 2012
David Chelimsky 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
Jun 24, 2012
David Chelimsky dchelimsky ensure the eq matcher sends :== to actual (not expected) a3e2839
Jul 07, 2012
David Chelimsky dchelimsky add travis badge to README adaaa9b
David Chelimsky dchelimsky space, the final frontier b394f47
David Chelimsky dchelimsky bump to 2.11.0 45161a7
David Chelimsky dchelimsky improve automation for publishing to relishapp.com 705ddc5
Jul 08, 2012
David Chelimsky 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
David Chelimsky dchelimsky changelog for 2.11.1 release c6da0f6
David Chelimsky dchelimsky bump to 2.11.1 3ae2ff7