Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

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

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: rspec/rspec-mocks
...
head fork: rspec/rspec-mocks
Checking mergeability… Don't worry, you can still create the pull request.
Commits on Nov 08, 2013
@yujinakayama yujinakayama Correct the entry of should syntax deprecation in changelog
It's not disabled, it's deprecated.

[ci skip]
ecad228
@myronmarston myronmarston Merge pull request #457 from yujinakayama/correct-entry-of-should-syn…
…tax-deprecation

Correct the entry of should syntax deprecation in changelog
b147181
@myronmarston myronmarston Fix typo.
[ci skip]
54f9556
Commits on Nov 09, 2013
@myronmarston myronmarston Remove dead code. a3fe04c
@myronmarston myronmarston Squat on less of the user's method namespace.
RSpec::Mocks::ExampleMethods is mixed into a context
where users freely define their own methods.  As such,
it's best to not define private helper methods as the
user may inadvertently overwrite them. These methods
were all stateless, anyway, so they work equally well
as class methods and this creates less surface area
for override problems.
b38b71f
@myronmarston myronmarston Merge pull request #459 from rspec/less-namespace-squatting
Squat on less of the user's method namespace.
513a794
@xaviershay xaviershay Clarify verifying double documentation.
* Moves introduction to README so it shows on the index page.
* Made intro text more generic to account for object doubles.
* Rename old introduction feature to "instance doubles" for symmetry
  with class and object double features.
2023a2b
@xaviershay xaviershay Allow string representations of methods in double constructor.
3430684
@xaviershay xaviershay Document behaviour of doubling setter methods. 8e48425
@xaviershay xaviershay Copy changes and extra link, addressing feedback.
5c96492
@xaviershay xaviershay Flesh out instance double docs. 82e33f7
@myronmarston myronmarston Merge pull request #460 from rspec/issue-456
Clarify verifying double documentation.
15bbce4
@myronmarston myronmarston Merge pull request #461 from rspec/issue-458
Allow strings representations of methods in double constructor.
801ef36
@myronmarston myronmarston Fixup README code formatting.
- Spaces between method args.
- A space between `#` and the comment text.
86abf8d
@myronmarston myronmarston Rename `Mock` to `Double` in class names, etc.
We've already removed `mock` as an alias for `double`,
might as well make class names and descriptions consistent.
ef4aa3b
Commits on Nov 10, 2013
@myronmarston myronmarston Add changelog.
1eae4a8
@myronmarston myronmarston Declare some more classes as not part of the public API. 3a0d8a2
Commits on Nov 11, 2013
@myronmarston myronmarston Merge pull request #462 from rspec/remove-mock-class
Remove mock class
0676809
@myronmarston myronmarston Fixup changelog.
[ci skip]
4cbc14a
Commits on Nov 12, 2013
@JonRowe JonRowe allow verification of private methods
cb027f6
@JonRowe JonRowe assert on verification of private class methods 568092c
@JonRowe JonRowe Merge pull request #466 from rspec/allow_verification_private_methods
Verifying partial doubles doesn't work with private methods
beea967
Commits on Nov 14, 2013
@xaviershay xaviershay Add verifying doubles to README.
32d85e9
@xaviershay xaviershay Remove reference to mock and stub in features README.
dd0485f
@xaviershay xaviershay Consistent double documentation across README and features README. c7ac609
@xaviershay xaviershay Fix accidental reference to account. 4cae12c
@myronmarston myronmarston Merge pull request #468 from rspec/issue-463
Add verifying doubles to README
d09fc8f
Commits on Nov 15, 2013
@stuarthicks stuarthicks Update Readme to mention what the parameter is for double() and that …
…it is optional
b01f908
@myronmarston myronmarston Merge pull request #470 from stuarthicks/master
Update Readme to explain the identifier parameter for double()
56b997e
Commits on Nov 18, 2013
@michihuber michihuber Don't override let definitions with argument matchers
see #102

ArgumentMatchers (together with ExampleMethods) were
included into the ExampleGroup instance's metaclass.
This caused argument matcher methods such as boolean()
or hash_containing() to override let definitions with
the same name.

This commit fixes this bug by including
ArgumentMatchers into the example group's class and
not into the metaclass.

Conflicts:
	Changelog.md
	lib/rspec/mocks.rb
	spec/rspec/mocks/mock_spec.rb

(This commit originated in rspec/rspec-mocks#238. At this point,
the rest of the changes in that aren't valid or needed, and the
broken behavior these specs documented has been fixed upstream
in rspec-core by rspec/rspec-core#1188)
655294c
@myronmarston myronmarston Simplify spec a bit.
We don't need to exhaustively test every argument
matchers method; one will do.
0f55ff5
@myronmarston myronmarston Remove unnecessary module inclusion.
As of rspec/rspec-core#1188, rspec-core now takes
care of including the ExampleMethods module.
This should be faster (including once, rather than
once-per-example) and fixes #102.
e6bf83c
@myronmarston myronmarston Prefer `def self.` for defining class methods.
Using the singleton method syntax is problematic
as further down in the file it's not clear that
you are in the singleton class context. `def self.`
makes it very clear you are defining class methods.
1d36254
@myronmarston myronmarston No need to re-setup space in each example.
Setting it up once at load time is sufficient.
This should be faster (doing no per-example setup
is faster than doing some per-example setup).
bf9320d
@myronmarston myronmarston Document the methods defined in RSpec::Mocks.
4ab5bb3
@myronmarston myronmarston Update cukes to demo how to use rspec-mocks outside rspec-core. 7af0bec
@myronmarston myronmarston Add changelog entries. b8d745e
@stuarthicks stuarthicks Update features README to include same clause specifying optional ide…
…ntifier parameter for doubles()
69914ed
@JonRowe JonRowe Merge pull request #472 from stuarthicks/master
Update features README to also include explanation of doubles() parameter
71da53b
@samphippen samphippen Add allow(...).to receive_message_chain 3ddd8ab
@samphippen samphippen Merge pull request #467 from rspec/receive-chained-messages
Add allow(...).to receive_message_chain
4662eb0
Commits on Nov 20, 2013
@myronmarston myronmarston Remove unneeded `initialize` definitions/args.
6d68428
@myronmarston myronmarston Unwrap unnecessary Array#include?.
- The old version created an extra object (the array).
- It also involved more message sends:
  - Array#include?
  - `==` to each element

For a static list of 2 items, it will perform better
to just compare each item individually.
2b3ddf4
@myronmarston myronmarston Remove support for ArgumentListMatcher block.
This feature was removed in #426, but this bit of
the implementation of that feature remained.
83d34c3
@myronmarston myronmarston Switch arg matchers to use `===` rather than `==`.
* `==` should be symmetric; `a == b` and `b == a` should return the same
  value. This wasn't the case before.
* `===` need not be symmetric; it's designed for matching in case
  statements, which matches the semantics we want.
* `===` opens up new avenues of flexibility (e.g. lambdas can be
  passed on 1.9+ as an arg matcher since they implement `===`).
* This allows us to simplify our logic and remove some
  classes.
75c2878
@myronmarston myronmarston Make it clear what the public API in this file is.
- Add YARD docs to differentiate.
- Move the private stuff below the public stuff
  so the public stuff is more prominent.
aaf1933
@myronmarston myronmarston Remove unused line.
This was causing a ruby warning:

rspec-mocks/spec/rspec/mocks/matchers/receive_message_chain_spec.rb:130: warning: assigned but unused variable - o
fb1d450
@myronmarston myronmarston Add changelog entry. 6c80678
@JonRowe JonRowe Merge pull request #471 from rspec/fix-102
Stop including `RSpec::Mocks::ExampleMethods` in the singleton class of the example
e0b27a1
Commits on Nov 21, 2013
@myronmarston myronmarston Merge pull request #473 from rspec/fix-arg-matchers
Refactor arg matchers
a741ac9
Commits on Nov 22, 2013
@myronmarston myronmarston Refactor TestDouble#method_missing.
* Always record the message was received. I think it was
  a bug that for `to_int`, `to_a` or `to_ary` that was
  skipped.
* Move the `return self` case for null objects into the
  existing case statement: no reason to have it later.
* Memoize `__mock_proxy` in a local -- this saves us
  from having to look it up in a hash a few times.
* Simplify the way errors get raised from this method.
  Rather than calling `super` and rescuing `NameError`,
  Just raise the errors directly. I believe this will
  be faster but haven't benchmarked it.
cd81094
@myronmarston myronmarston Use symbols not strings for visibility.
c720de3
@myronmarston myronmarston Refactor: favor polymorphism over type checks.
0e9f28b
Commits on Nov 23, 2013
@samphippen samphippen Only disable the should syntax warnings when the default syntax host …
…is passed
1f7aa21
@myronmarston myronmarston Verified doubles should match the visibility of the interface they ve…
…rify against.
4cd26ac
@myronmarston myronmarston Verified null object doubles should implement `respond_to?` correctly.
bec8f14
@myronmarston myronmarston Refactor method_visibility helper methods.
4187a5a
@myronmarston myronmarston `m` is a terrible variable name.
0204ce2
@myronmarston myronmarston Rename mis-named variable.
It may not be a module reference anymore.
It may be an object reference.
ef08a22
@myronmarston myronmarston Use `public_method_defined?` not `method_defined?`.
It's more accurate. Also put the more common case
(public methods) first. It should be hit more
often and thus be a tiny bit faster.
7c1fd12
@myronmarston myronmarston Leverage our new method visibility helper methods.
Fixes #475.
cfca570
@myronmarston myronmarston Add changelog entries. 6bd92e5
@myronmarston myronmarston Fix null_object `respond_to?` to handle private/protected correctly. de41eea
@myronmarston myronmarston Add benchmark. 6e86448
Commits on Nov 24, 2013
@sanemat sanemat Test against ruby 2.1.0-preview2 c442be7
@myronmarston myronmarston Merge pull request #478 from rspec/visibility-improvements
Visibility improvements
c826cd2
@myronmarston myronmarston Merge pull request #479 from sanemat/feature/travis-ruby-2-1
Test against ruby 2.1.0-preview2
8f5017d
Commits on Nov 26, 2013
@JonRowe JonRowe Merge pull request #477 from rspec/should-syntax-host-warnings
Only disable the should syntax warnings when the default syntax host is passed
e2949e7
@myronmarston myronmarston Fix expect syntax to properly forward do..end blocks.
Previously, `do...end` blocks were forwarded to
`MessageExpectation#initialize`, such that something like this:

allow(obj).to receive(:foo).with(1) do
  :return_value
end

...was translated into:

obj.stub(:foo) { :return_value }.with(1)

In practice, this caused a confusing/wrong "you are overriding
this stub" warning.

Our fix is to forward them on to the last method in the matcher
chain. This ensures that it gets forwarded to the method the user
intends.
4a8f672
@myronmarston myronmarston Fix warning to only be emitted when it is true.
1d74976
@myronmarston myronmarston Improve stub override warning message.
- Mention what method's stub is being overridden.
- Include the call site.

The old message was:

You're overriding a previous implementation for this stub.

…which doesn't give you much to go off of.
f7035d6
@myronmarston myronmarston Remove old invalid comment.
e60dd3d
@myronmarston myronmarston Document implementation classes as private.
c2481d4
@myronmarston myronmarston Add changelog for #477.
ff17d16
@myronmarston myronmarston Add changelog entry. 2ef3ee8
@myronmarston myronmarston Merge pull request #481 from rspec/fix-override-warning
Fix override warning
b78a1ab
Commits on Nov 29, 2013
@JonRowe JonRowe switch deprecation/warning helpers to support
9a8ea86
@JonRowe JonRowe supress legitimate warnings 5240413
@JonRowe JonRowe these sometimes emit warnings about to_a but seem harmless
1baaff3
@JonRowe JonRowe squash syntaxes in a 1.8.7 friendly way 3af87b8
@JonRowe JonRowe Merge pull request #483 from rspec/switch_deprecations_helpers_to_sup…
…port

Switch over warning / deprecation helpers to support
fde8d40
Commits on Nov 30, 2013
@myronmarston myronmarston Use rspec-support's simplecov setup logic.
b3a256a
@myronmarston myronmarston Remove old rcov tasks. 184ab52
@myronmarston myronmarston Merge pull request #484 from rspec/improve-simplecov-setup
Improve simplecov setup
4e1eedc
@myronmarston myronmarston Update changelog.
[ci skip]
ca4e3d3
Commits on Dec 01, 2013
@myronmarston myronmarston Update `have_received` matcher to latest protocol. 1ec31b5
Commits on Dec 03, 2013
@myronmarston myronmarston Merge pull request #485 from rspec/update-matchers
Update `have_received` matcher to latest protocol.
0baed36
Commits on Dec 04, 2013
@JonRowe JonRowe change unstub warning to remove mention of expect f67a4ca
@JonRowe JonRowe Update Rubinius on Travis
Travis actually dropped (due to rvm dropping) support for rbx-1.8 and
rbx-1.9. There is now the option to have 2.2.1 and head. We should do
something about this.
0ed4de1
@myronmarston myronmarston Merge pull request #487 from rspec/travis_builds
Update Rubinius on Travis
822c6f5
Commits on Dec 06, 2013
@myronmarston myronmarston Cleanup matcher support.
Now that rspec-expectations matchers implement
#===, there's no need to treat them special here.
f628d11
@myronmarston myronmarston Merge pull request #489 from rspec/cleanup-matcher-support
Cleanup matcher support.
6c4052f
@wicz wicz Fix Markdown link d81cfc0
@wicz wicz Fix feature to load dependencies as expected
The spec wasn't loading the dependencies as it should. Even with
`ConsoleNotifier` defined, the spec was running in isolation.
2e0ab0d
@myronmarston myronmarston Merge pull request #490 from wicz/fix-readme
Fix Markdown link.
3d954d1
Commits on Dec 07, 2013
@xaviershay xaviershay Merge pull request #491 from wicz/fix-feature
Fix feature to load dependencies.
22864a0
@JonRowe JonRowe change unstub message to include replacemnt 30fb2f1
@myronmarston myronmarston Add specs showing how `and_call_original` can be used like `unstub`.
c5b0080
@myronmarston myronmarston Tweak deprecation message a bit.
The deprecation is worded in general terms so it
seems odd for the replacement to be specific about
which message (particularly since it's not specific
about which object is passed to `allow`).
b4cc83a
@JonRowe JonRowe Merge pull request #486 from rspec/change_unstub_warning
Deprecation warning should mention that `unstub` has no replacement in new syntax
2c64331
Commits on Dec 08, 2013
@JonRowe JonRowe fixup unstubing of sub classes when super classes are stubbed, fixes #… 952d954
@JonRowe JonRowe Merge pull request #488 from rspec/fixup_any_instance_super_sub_class…
…_stub

Fix `any_instance.unstub` of subclasses which have been `any_instance.stub`ed.
60d08de
Commits on Dec 15, 2013
@myronmarston myronmarston Add rubysl for rbx. 9124d8c
@JonRowe JonRowe add rubysl-test-unit for travis 92b9f9e
@JonRowe JonRowe Merge pull request #495 from rspec/fix-rbx-build
Add rubysl for rbx.
41b8a44
Commits on Dec 20, 2013
@myronmarston myronmarston `red carpet` won't install on jruby.
952c0e8
@myronmarston myronmarston Fix spec that was failing on jruby.
On jruby, the error for calling an undefined method
is a bit inconsistent:

The first time:

"undefined method `abcd' for #<#<Class:0x3cdb8522>:0x70019a64>"

The second time:

"undefined local variable or method `abcd' for #<#<Class:0x3cdb8522>:0x70019a64>"
3bb9afc
@myronmarston myronmarston Merge pull request #499 from rspec/fix-jruby-builds
Fix jruby builds
a274807
@tundal45 tundal45 Update the documentation to use the new expectation syntax.
* Update cukes to use the new expectation syntax where possible.
* Update RDoc documentation to use the `expect` syntax where applicable.
* Add RDoc documentation for `syntax=` & `syntax` methods.
* Rename cukes to reflect new syntax.
087ea72
@myronmarston myronmarston Merge pull request #497 from tundal45/move_to_expectation_syntax_in_d…
…ocs_cukes_and_readmes

Update documentation to use the new expectation syntax.
21e977e
@myronmarston myronmarston Update 2.1 to rc1. 0c9fb7a
@myronmarston myronmarston Merge pull request #500 from rspec/update-2.1-build
Update 2.1 to rc1.
5f47242
Commits on Dec 28, 2013
@arthurnn arthurnn travis config: Use latest 2.1 2081e74
Commits on Dec 30, 2013
@samphippen samphippen Add specs demonstrating how args work with receive_message_chain 4b9d6b7
Commits on Dec 31, 2013
@samphippen samphippen Fix inline hash return with args in message_chain
Closes #509
30b1648
@myronmarston myronmarston Merge pull request #505 from arthurnn/master
travis config: Use latest 2.1
36c1d32
@myronmarston myronmarston Add temporary workaround for failing build on Ruby 1.8.7
Rubygems broke builds on Ruby 1.8.7:

travis-ci/travis-ci#1793
rubygems/rubygems#763

This patch is a temporary workaround until rubygems is updated.
af83c30
@myronmarston myronmarston Just build against latest rbx release.
Our build is broken against 2.2.1:

rubinius/rubinius#2855
e5bbdfd
@samphippen samphippen USe a proc on message_chain as it takes any args
f888eee
@samphippen samphippen Improve the argument related message_chain specs e03c121
Commits on Jan 01, 2014
@myronmarston myronmarston Refactor: leverage rspec-support's fuzzy matching. eb8bbba
@myronmarston myronmarston Use `method_handle_for` from rspec-support. b33e36d
@myronmarston myronmarston Merge pull request #512 from rspec/use-method-handle-for-from-support
Use `method_handle_for` from rspec-support.
28fc4f4
@myronmarston myronmarston Merge pull request #508 from rspec/spec-stub-chain-args
Add specs demonstrating how args work with receive_message_chain
1beeb65
@myronmarston myronmarston Add changelog for #508.
[ci skip]
1e15b6e
@JonRowe JonRowe Merge pull request #511 from rspec/use-fuzzy-matcher
Refactor: leverage rspec-support's fuzzy matching.
90c3c28
Commits on Jan 02, 2014
@samphippen samphippen Prevent doubles and partial doubles being used outside of tests.
For example: in a before(:all) block.
b88a050
@samphippen samphippen Merge pull request #449 from rspec/warn-stubbing-before-all
Initial implementation of warning in before(:all) blocks
b6ca52f
@samphippen samphippen Remove the host argument from RSpec::Mocks.setup b69dce8
@samphippen samphippen Merge pull request #514 from rspec/remove-host-argument
Remove the host argument from RSpec::Mocks.setup
1a9f0b2
Commits on Jan 03, 2014
@samphippen samphippen Add a changelog entry for #514 66dcbda
@samphippen samphippen Fix a warning introduced with some orderings on the before(:all) specs 7a0820a
@samphippen samphippen Protect from fixnum to array casting on 1.8.7 in a failing spec. 30ee112
@samphippen samphippen Merge pull request #516 from rspec/mocks-lifecycle-fixup
Fix a warning introduced with some orderings on the before(:all) specs
3296d74
@myronmarston myronmarston Allow objects to be marshaled outside per-test lifecycle. 5bd9a09
@myronmarston myronmarston Remove some config that's been moved into rspec-support. d6c3e52
@myronmarston myronmarston Move these specs under the `RSpec::Mocks::Double` example group.
These were defined at the top level with descriptions
like `==` or `with`, which made no sense without the
context of `RSpec::Mocks::Double`.
325139b
@myronmarston myronmarston Merge pull request #518 from rspec/fix-registered-error-space
Allow objects to be marshaled outside per-test lifecycle.
e31f355
Commits on Jan 04, 2014
@myronmarston myronmarston Stop double-resetting mock proxies.
We don't need to reset the mock proxy while verifying it.
That'll happen later during the teardown phase.

It looks like the main reason we were doing this was
to assist with rspec-mocks testing itself; we would
verify the middle of an example to assert a mock expectation
failure, and a `reset` is needed so it doesn't fail again
when rspec-core calls `verify` as well.

The solution is to use spec helper methods that perform
the reset when we verify in the middle of an example.

I don't have any evidence this improves perf, but it
seems reasonable to assume that removing an extra method
call per example can only make it faster (however slight
the improvement may be).

Fixes #165.
c439349
@myronmarston myronmarston Remove test we no longer need.
The logic that required this test was removed in cd81094.
acd9a45
@myronmarston myronmarston Update spec to only specify the behavior we are keeping.
We're going to change the behavior of test doubles
that have been reset (so that they "expire" and can
no longer be used). This spec was originally added in
847c66d where the
point was to address an error while resetting a test
double (which, in turn caused that method double
to stick around into later examples and continue to
fail).
6489742
@myronmarston myronmarston Split spec into two.
The second part of this spec was added in
9357e4d. We are
changing test doubles so that they self-destruct
after being reset. Currently, `verify` also
resets, so verifying a test double twice
will no longer be allowed.
358fbdb
@myronmarston myronmarston Update teardown spec.
We're going to change how pure test doubles behave
after teardown, so update this to focus on partial
doubles (which will not be changed).
0df4884
@myronmarston myronmarston Make test doubles self-destruct after the example completes.
Test doubles are not designed to be used outside of
the example they were created in.
f83810b
@myronmarston myronmarston No need for ProxyForNil to have its own file.
3138bba
@myronmarston myronmarston Centralize error classes in error_generator.rb.
Also, document some of them as public since
users may want to rescue them, or specify
a block will raise one of these errors
(e.g. in an rspec-mocks extension gem).
b639f7e
@myronmarston myronmarston Move error_space.rb into space.rb
There's no need for a separate file and there's
going to be a bit of interaction between multiple
spaces at various layers in a stack so having it
in one file will make it easier to see how it relates.
83e56b0
@myronmarston myronmarston Remove an unnecessary layer of indirection.
* This should be faster (but almost certainly not
  noticably so).
* It was odd to expose these methods off of `RSpec::Mocks`
  given that they are not intended for usage outside
  rspec-mocks.
* We weren't getting any benefit from these except
  for not having to type `.space`.
e685867
Commits on Jan 05, 2014
@myronmarston myronmarston Having a private `pretty_print` method causes problems.
When rspec-expectations tries to diff the object in
a failure message, it blows up when the `pp` library
tries to print it.
513bdb1
@myronmarston myronmarston Refactor: store const mutators in mock space.
This unifies global storage of modified things in one place.
9da93fd
@myronmarston myronmarston Re-work spec file a bit.
- Make it more general (it's not just about stubbing).
- Remove unused lines.
- Improve doc output (`include_examples` does not
  create a nested group).
7c94a6f
@myronmarston myronmarston Don't allow const stubbing/hiding from before(:all).
d89e680
Commits on Jan 06, 2014
@myronmarston myronmarston Refactor space tracking so it uses a stack and allows nesting.
c28b379
@myronmarston myronmarston Add RSpec::Mocks.with_temporary_scope.
Closes #240.
3dcef6d
Commits on Jan 07, 2014
@myronmarston myronmarston Clean up expectation ordering.
- It was duplicated in Proxy.
- Makes more sense to initialize it in Space init.
98f065e
@myronmarston myronmarston Simplify spec.
rspec-mocks lacks the necessary sandboxing to safely
define and run examples from within examples.
rspec-core has and uses this but it's not exposed
for use here.

Instead, we can just trigger the teardown/setup
that happens between examples.

This fixes some rspec-mocks space leakage
that was happening.
d2b335e
@myronmarston myronmarston Move mock_space_spec specs into space_spec.rb
Not sure how we wound up with two separate files, anyway.
90cf550
@myronmarston myronmarston Remove unnecessary collection clearing.
Since we now use a new space instance per example,
we don't need to clear its collections when resetting.
Before this was necessary because we kept a space instance
that we would keep using for the lifetime of the process.

Constant mutators weren't being reset idempotently, so I
had to tweak them a bit.
fab5210
@myronmarston myronmarston Add changelog entry for test-double self-destruction.
[ci skip]
3ab7925
@myronmarston myronmarston Indent `private` at same level as class.
This is our preferred convention.
c08a408
Commits on Jan 09, 2014
@myronmarston myronmarston Merge pull request #519 from rspec/lifecycle-space-fixups
Lifecycle/space fixups
8615dc2
@myronmarston myronmarston Fix indentation.
4cf7d25
@myronmarston myronmarston Add spec for `have_received` lifecycle issue. 949e2d6
Commits on Jan 11, 2014
@myronmarston myronmarston Fix null_object double visibility bug.
The error being raised had the word "private" in
it only because the method itself had that in its
name, but this did not indicate it was raising
the normal "private method called" error raised
by ruby.
74e7990
@myronmarston myronmarston Allow null object verified doubles to receive private methods using `…
…send`.

This mirrors the behavior of the real object.
37300da
@myronmarston myronmarston Fix 1.8.7.
I'm not sure why, but aliasing `__send__` to `send`
on 1.8.7 doesn't work correctly. Defining the alias
manually does, for some reason.

While we're at it, it makes more sense to define
`__send__` as primary and `send` as secondary,
as it's more likely users will stub `send`
(e.g. for an `email` object).
50f4d56
@myronmarston myronmarston Add specs to ensure `send` can be stubbed. 8776594
@myronmarston myronmarston Work around JRuby bug. c601d58
@myronmarston myronmarston Merge pull request #524 from rspec/fix-null-object-visibility
Fix null object visibility
7aaa623
Commits on Jan 23, 2014
@myronmarston myronmarston Delete unneeded script.
[ci skip]
ed10867
@myronmarston myronmarston Update test-all script so it builds against core and expectations.
If we break those gems we want to be notified about it.
c81e9f9
@myronmarston myronmarston Update .travis.yml.
- Build against ruby-head and jruby-head but allow failures.
- We don't need the before_install stuff anymore.
ef7fcbc
Commits on Jan 24, 2014
@myronmarston myronmarston Add travis_retry to bundle install. 7f0828a
@myronmarston myronmarston Revamp travis build.
- Only run the one-by-one specs and the builds for other
  gems on MRI. JRuby and RBX are too slow and flakey.
- Before `bundle install`, clone all repos to sibling dirs.
  This makes the later bundle installs for the other repos
  *much* faster since they don't have to re-clone the rspec
  repos and can instead share the same checkouts.
- Using a common bundle directory to minimize the number of
  gems that have to be re-installed.
- Reinstate using bin/cucumber for faster cuke runs.
  Running w/o bundler removes the "bundler tax" of having
  bundle to runtime checks everytime we shell out to `rspec`.
- Reorganize build scripts for easier maintenance.
- Make certain parts of the build idempotent, so that, for
  example, the main repo isn't re-cloned or the specs re-run.
  This will allow us to re-use these scripts in all repos
  w/o changing them. Otherwise each would have to be a bit
  different and skip the extra clone and run of their own
  repo and specs.
d58bab9
@myronmarston myronmarston We're still having cucumber problems with bin/cucumber :(. a828f11
@myronmarston myronmarston Use `bundle exec cucumber` only on 1.9.2.
It's the only ruby that gets a system stack error
from the `bin/cucumber` approach. `bin/cucumber`
is faster as it avoids loading bundler at runtime.
34be259
@JonRowe JonRowe Merge pull request #530 from rspec/multi-build
Update test-all script so it builds against core and expectations.
bc05246
Commits on Jan 25, 2014
@myronmarston myronmarston Updated travis build scripts (from rspec-dev) 9ad40d1
@xaviershay xaviershay Better error message when calling private method on a verifying double.
Fixes #531.
6464e4c
@JonRowe JonRowe Merge pull request #537 from rspec/issue-531
Better error message when calling private method on a verifying double.
4893886
@myronmarston myronmarston Merge pull request #536 from rspec/update-travis-build-scripts-2014-0…
…1-24

Updates from rspec-dev (2014-01-24)
8ec4f5b
@myronmarston myronmarston Updated travis build scripts (from rspec-dev) 77e9bc5
@xaviershay xaviershay Justify uses of known techniques that bust the method cache.
I don't see a way to remove any of these.

Addresses #268.
d309175
Commits on Jan 26, 2014
@xaviershay xaviershay Correct stub undefined parent modules all the way down when stubbing …
…a nested

constant.

This is necessary for verifying doubles to work correctly, since they
need to distinguish between real and stubbed constants.

Fixes #529.
1827ee4
@xaviershay xaviershay Merge pull request #541 from rspec/issue-529
Correct stub undefined parent modules all the way down when stubbing a nested constant.
fd6af3c
@myronmarston myronmarston Merge pull request #540 from rspec/update-travis-build-scripts-2014-0…
…1-25

Updates from rspec-dev (2014-01-25)
19b9df5
@myronmarston myronmarston Merge pull request #542 from rspec/issue-268
Justify uses of known techniques that bust the method cache.
e64e6a1
Commits on Jan 27, 2014
@JonRowe JonRowe cleanup stray whitespace 0c06dce
@myronmarston myronmarston Merge pull request #546 from rspec/cleanup
Cleanup stray whitespace
7a82328
Commits on Jan 28, 2014
@xaviershay xaviershay Support keyword arguments when checking for valid arity.
This changes the error message that was included in the ArgumentError
raised when arity was incorrect. It used to match the default Ruby
message, it now uses our enhanced error message. While it would be
technically more correct to emulate the Ruby one, ours is more useful and the
logic required would now have to be more complicated to support keyword
arguments.

Fixes #431.
eb1a63a
@xaviershay xaviershay Extract RubyFeatures module.
72a8e7c
@xaviershay xaviershay Remove unused local.
87d2f2f
@xaviershay xaviershay More specific argument matcher.
abf08e8
@xaviershay xaviershay Rename ArityCalculator to MethodSignature.
8ebdb64
@xaviershay xaviershay Remove TODO (already done).
96005cb
@xaviershay xaviershay Drop coverage threshold to 96%.
The drop is due to the addition of more implementation-specific code
that has created more lines that are unable to be tested on a single
Ruby.
42230d9
@xaviershay xaviershay Support checking for allowed keyword arguments. 79c9ce2
@xaviershay xaviershay 1.8 compat 2e20367
@xaviershay xaviershay Refactor MethodSignature to MethodSignatureVerifier. 013b1c0
@myronmarston myronmarston Merge pull request #543 from rspec/issue-431
Support keyword arguments when checking for valid arity.
f5364ac
Commits on Jan 29, 2014
@myronmarston myronmarston Standardize on kw_args over keyword_args.
It's a bit shorter but still obvious what it means.
ad6a7e6
@myronmarston myronmarston Refactoring: extract MethodSignature class.
- The signature of a method is a concept in its own
  right and deserves to be represented as its own object.
- This gives a clear delineaziation of responsibilities
  between extracting method signature info and verifying
  arguments against that info.
- The new `classify_parameters` approach should perform
  a bit better than what we had before; it iterates over
  `method.parameters` once total where as before it would
  iterate over it 3 times.
83f2e31
@myronmarston myronmarston Add missing test.
A last-arg hash should only be treated as kw args if the method has kw arg params.
ecca155
@myronmarston myronmarston Clean up `split_args` a bit.
- It was odd to have it memoize internally but accept an arg.
- Simpler just to call it once in `initialize`.
4a8a003
@myronmarston myronmarston Decrease syntactic noise of argument lists.
I find this:

foo(nil, :a => 1)

...to be much less noisy than this:

foo([nil, { :a => 1 }])

The first form more closely matches how people pass args
and kw args to methods, anyway.
3769d40
@myronmarston myronmarston Refactor: prep for supporting `**kw_args`.
To support `**kw_args`, `allowed_kw_args` will have
to act like an infinite set. Rather than making the
verifier (and any future clients) responsible for
dealing with this special case, it's simpler to move
the invalid/missing kw arg calculations into
`MethodSignature`, where it can handle that special
case internally.
5384099
@myronmarston myronmarston Add support for `**kw_args` parameters.
7e997eb
@myronmarston myronmarston We can't count on `is_a?` working on every argument.
BasicObject, for example, does not respond to it.
It's safer to use `SomeClass === obj` than `obj.is_a?(SomeClass)`.
86b2a68
@myronmarston myronmarston Don't mutate the provided args array.
Mutating could lead to surprises for the caller.
8e1ac5f
@myronmarston myronmarston Replace multiple conditionals with a single case statement.
c313778
@myronmarston myronmarston `error` => `error_message`
It's not a ruby error object, it's just the message,
so the new name is more accurate.
0ccef42
@myronmarston myronmarston Update method names, etc to reflect our check is more than arity.
Arity is just the number of arguments but we check
more than that now, so it's good to reflect that.
ae521db
Commits on Jan 30, 2014
@myronmarston myronmarston Rename method.
It's a description of the arity so let's call it that.
55a76e0
@myronmarston myronmarston Refactor: make caller pass a signature object.
This clears the way to use a slightly different
signature implementation (e.g. for blocks).
fd3869c
@myronmarston myronmarston Reword docstrings.
I'm about to introduce a new `description` method
and having docstrings say "it is described precisely"
when not referring to the description is confusing.
2f33286
@myronmarston myronmarston Use method signature verifier for `and_yield` block verification. e1aaad5
Commits on Jan 31, 2014
@mauricio mauricio RSpec::Mocks::NamedObjectReference doesn't have a name method, creati…
…ng specific spec for this case so there are no false positives
0816926
@JonRowe JonRowe Merge pull request #550 from mauricio/better-error-on-verifying-double
RSpec::Mocks::NamedObjectReference doesn't have a name method, creating specific spec for this case so there are no false positives
442142e
@JonRowe JonRowe changelog for #550
[skip ci]
745d2a6
@myronmarston myronmarston Merge pull request #548 from rspec/improve-method-signature
Improve method signature / argument validation
dceb9e6
Commits on Feb 01, 2014
@myronmarston myronmarston Add regression spec for #549.
This is already fixed in 3.0 but it's good to add
a spec to prevent future regressions.
e8d6911
@JonRowe JonRowe Merge pull request #553 from rspec/add-spec-for-issue-549
Add regression spec for #549.
a8e8aeb
@myronmarston myronmarston Update changelog with 2.14.5 release notes.
[ci skip]
7b9930b
Commits on Feb 07, 2014
@yujinakayama yujinakayama Remove support for `and_return { value }`
492c3ec
@yujinakayama yujinakayama Disallow `and_return` without arguments e1c9a3e
@JonRowe JonRowe Merge pull request #561 from yujinakayama/remove-and_return-without-args
Remove support for `and_return { value }`
0672741
Commits on Feb 08, 2014
@JonRowe JonRowe Updated travis build scripts (from rspec-dev) 3ed7151
@JonRowe JonRowe Merge pull request #562 from rspec/update-travis-build-scripts-2014-0…
…2-08-for-master

Updates from rspec-dev (2014-02-08)
ed09490
Commits on Feb 10, 2014
@myronmarston myronmarston Updated travis build scripts (from rspec-dev) 4b1a4b6
@myronmarston myronmarston Merge pull request #568 from rspec/update-travis-build-scripts-2014-0…
…2-10-for-master

Updates from rspec-dev (2014-02-10)
dc27a8b
@myronmarston myronmarston Use skip instead of pending.
The semantics of pending have changed in rspec-core.
39acf19
Commits on Feb 11, 2014
@JonRowe JonRowe Updated travis build scripts (from rspec-dev) c199f49
@JonRowe JonRowe Merge pull request #573 from rspec/update-travis-build-scripts-2014-0…
…2-12-for-master

Updates from rspec-dev (2014-02-12)
92eb7be
Commits on Feb 12, 2014
@mauricio mauricio Removes #to_str implememtation from test_double
Having test_double implement to_str makes the Ruby
runtime coerce it to a string whenever needed and
this isn't the intended behavior for this object.
This behavior led to issue #567 as Ruby will try
to coerce the exception object into string when raising
(here https://github.com/ruby/ruby/blob/191b373d26a48058bcc8955bf3afe426f60eaaea/eval.c#L678 )
an exception and since test_double does implement to_str
it succeded and raises that instead of failing with the
correct 'this is not an exception object' error.

This fixes #567 by providing a better error message
in it's case.
80c740e
Commits on Feb 17, 2014
@mauricio mauricio Ignoring `raise double()` specs for ruby 1.9.2
This ignores specs that check for the removal of
`to_str` from Ruby 1.9.2 as they won't work there
due to the Ruby runtime calling `to_str` on a double
without checking if the double implements `to_str`.
6c21ac6
@myronmarston myronmarston Move enhancements above bug fixes in changelog.
[ci skip]
55c00d4
@xaviershay xaviershay Grammar in Changelog.
[ci-skip]
1c6c770
Commits on Feb 18, 2014
@myronmarston myronmarston Merge pull request #577 from mauricio/issue-567
Removes #to_str implementation from test_double
44ef2ff
@myronmarston myronmarston Add changelog entry for #577.
[ci skip]
afe60cc
@myronmarston myronmarston Add release notes from 2.99.0.beta2.
[ci skip]
10cdaa3
@myronmarston myronmarston Update changelog for 3.0.0.beta2 release. [ci skip]
d40221e
@myronmarston myronmarston Release 3.0.0.beta2 e5c2ba0