- Rename RR::Adapters::RRMethods to RR::DSL, and deprecate RRMethods.
- Fix using RSpec's RR adapter to not override our RSpec adapter.
If RR is required and then you use
mock_with :rr
you would not be able to usehave_received
.
- Add tests, appraisals, etc. back to the published gem (#32). This is necessary because Debian wraps rr in a package, and they depend on the tests to be present in order to run them prior to packaging.
- Add back RR::Adapters::RSpec2 which was removed accidentally (#34). This fixes failures when running tests against sham_rack (which is no longer using RR, but, oh well).
- Remove deprecation warning about
RSpec.configuration.backtrace_clean_patterns under RSpec 2.14 (#37).
NOTE: This warning will continue to appear if you are configuring RSpec using
mock_with :rr
. This is because the RR adapter bundled with RSpec still refers tobacktrace_clean_patterns
instead ofbacktrace_exclusion_patterns
. You can either wait until the next release of rspec-core, or removemock_with :rr
(which is recommended at this point as we consider RSpec's adapter to be slightly out of date, and RR provides its own adapter for RSpec). - RR now officially supports Rails 4.0.0. (It worked before, but now we're explicitly testing against it instead of 4.0.0.rc1.)
- Fix Test::Unit 1 and 2 adapters to avoid a possible "undefined Test::Unit::TestCase" error.
- Prevent adapters from being double-loaded.
- Including RR::Adapters::TestUnit, RR::Adapters::MiniTest, or RR::Adapters::RSpec2 now just re-runs the autohook mechanism instead of building a fake adapter, as it was possible to include both a real and fake adapter in the same space and they could conflict with each other.
- Fix incompatibility issues with Rails 4 (#26) and Cucumber (#29).
- Add missing adapter for Test::Unit 2.0.0 (version which is built into Ruby 1.9/2.0). The tests for Jekyll were failing because of this (#27).
- If an error occurs while checking to see whether an adapter applies or when loading the adapter itself, it is now swallowed so that the user can move on.
NOTE: RR development moved from btakita/rr to rr/rr. Issues are re-numbered beginning from 1 from this point on.
- Fix a line in RR::Injections::DoubleInjection to use top-level RR constant (#3) [@Thibaut]
- Fix all wildcard matches so they work within hashes and arrays. This means
that
stub([hash_containing(:foo => 'bar')])
will matchstub([{:foo => 'bar', :baz => 'qux'}])
. (#4) - RR now auto-hooks into whichever test framework you have loaded; there is no
longer a need to
include RR::Adapters::Whatever
into your test framework. If you don't like the autohook and prefer the old way, simply userequire 'rr/without_autohook'
instead ofrequire 'rr'
. (There are now nine adapters; see lib/rr/autohook.rb for the full list.) - Fix Test::Unit adapters to ensure that any additional teardown is completely run in the event that RR's verify step produces an error. This was causing weirdness when using Test::Unit alongside Rails. (#2)
- Add an explicit Test::Unit / ActiveSupport adapter. As ActiveSupport::TestCase introduces its own setup/teardown hooks, use these when autohooking in RR. (#2)
- Add support for Minitest 5
- Upon release, the tests are now packaged up and uploaded to S3. This is for Linux distros like Fedora who wrap gems in RPM packages. You can always find the latest tests at http://s3.amazonaws.com/rubygem-rr/tests/vX.Y.Z.tar.gz, where X.Y.Z represents a version. I have retroactively packaged the tests for 1.0.4 and 1.0.5.
- Compatibility with RSpec-2. There are now two adapters for RSpec, one that
works with RSpec-1 and a new one that works with RSpec-2. Currently, saying
RSpec.configure {|c| c.mock_with(:rr) }
still uses RSpec-1; to use the new one, you sayRSpec.configure {|c| c.mock_framework = RR::Adapters::RSpec2 }
. (#66, #68, #80) [@njay, @james2m] - Fix MethodMissingInjection so that
[stub].flatten
works without throwing a NoMethodError (undefined method
to_ary'`) error under Ruby 1.9 (#44) - Raise a MiniTest::Assertion error in the MiniTest adapter so that mock failures appear in the output as failures rather than uncaught exceptions (#69) [@jayferd]
- Completely remove leftover #new_instance_of method, and also remove mention of #new_instance_of from the README
- Fix tests so they all work and pass again
- Fixed bug using workaround with leftover MethodMissingInjections
- Eliminate usage of ObjectSpace._id2ref (#63) [@evanphx]
- Added minitest adapter (#62) [@cespare]
- Added instructions on installing the gem (#57) [@gavingmiller]
- delete missing scratch.rb file from gemspec (#60) [@bonkydog]
- Fixed Two calls recorded to a mock expecting only one call when called via another mock's yield block (#42) [@libc]
- Removed new_instance_of for Ruby 1.9.2 compatibility. instance_of is now an alias for any_instance_of.
- Compatible with Ruby 1.9.2
- Added any_instance_of (aliased by all_instances_of), which binds methods directly to the class (instead of the eigenclass).
- Subclasses of a injected class do not have their methods overridden.
- any_instance_of and new_instance_of now have a block syntax
- Added RR.blank_slate_whitelist
- Fixed class_eval method redefinition warning in jruby
- Suite passes for Ruby 1.9.1
- Fixed 1.8.6 bug for real
- Fixed 1.8.6 bug
- Fixed issue with DoubleInjections binding to objects overriding the method method.
- Added MIT license
- Fixed Bug - dont_allow doesn't work when it follows stub (#20)
- Fixed exception with DoubleInjections on proxy objects (#24)
- Fixed Bug - Can't stub attribute methods on a BelongsToAssociation (#24)
- Handle lazily defined methods (where respond_to? returns true yet the method is not yet defined and the first call to method_missing defines the method). This pattern is used in ActiveRecord and ActionMailer.
- Fixed warning about aliasing #instance_exec in jruby. (#9) [@nathansobo]
- RR properly proxies subjects with private methods (#7)
- Fixed issue with DoubleInjection not invoking methods that are lazily created (#4)
- Fixed issue with mock.proxy and returns (#2)
- Method is no longer invoked if respond_to? returns false. This was in place to support ActiveRecord association proxies, and is no longer needed.
- instance_of Doubles now apply to methods invoked in the subject's #initialize method.
- Fixed exception where the Subject uses method delegation via method_missing (e.g. certain ActiveRecord AssociationProxy methods)
- Fixed compatibility issues with Ruby 1.9
- Aliased any_number_of_times with any_times
- Better error messages for have_received and assert_received matchers [@jferris]
- Better documentation on RR wilcard matchers [@phildarnowsky]
- Performance improvements
- Added spies [@jferris, @niessner, @mmangino]
- Added strongly typed reimplementation doubles [@niessner]
- Fixed DoubleDefinition chaining edge cases
- DoubleDefinitionCreatorProxy definition eval block is instance_evaled when the arity is not 1. When the arity is 1, the block is yielded with the DoubleDefinitionCreatorProxy passed in.
- Friendlier DoubleNotFound error message
- Implemented Double strategy creation methods (#mock, #stub, #proxy, #instance_of, and ! equivalents) on DoubleDefinition
- Implemented hash_including matcher [Matthew O'Connor]
- Implemented satisfy matcher [Matthew O'Connor]
- Implemented DoubleDefinitionCreator#mock!, #stub!, and #dont_allow!
- Modified api to method chain Doubles
- Fix conflict with Mocha overriding Object#verify
- Method chaining Doubles [@nkallen]
- Chained ordered expectations [@nkallen]
- Space#verify_doubles can take one or more objects with DoubleInjections to be verified
- DoubleDefinitionCreatorProxy does not undef #object_id
- Fixed rdoc pointer to README
- Proxying from RR module to RR::Space.instance
- Fixed issue with Hash arguments
- Improved error message
- Added Double#verbose and Double#verbose?
- Fixed doubles for == and #eql? methods
- Doc improvements
- Methods that are not alphabetic, such as ==, can be doubles
- Doc improvements
- Cleanup
- Finished renaming scenario to double
- Renamed DoubleInsertion to DoubleInjection to be consistent with Mocha terminology
- Fixed backward compatability issues with rspec
- Renamed Space#verify_double_insertions to #verify_doubles
- Documentation improvements
- Renamed Double to DoubleInsertion
- Renamed Scenario to Double
- Fixed [#13724] Mock Proxy on Active Record Association proxies causes error
- Fixed [#13139] Blocks added to proxy sets the return_value and not the after_call callback
- Alias probe to proxy
- Implemented [#13009] Better error mesage from TimesCalledMatcher
- Fixed [#12928] Reset doubles fails on Rails association proxies
- Fixed [#12765] Issues with ObjectSpace._id2ref
- trim_backtrace is only set for Test::Unit
- Implemented instance_of
- Fixed [#12495] Error Probing method_missing interaction
- Fixed [#12486] ScenarioMethodProxy when Kernel passed into instance methods
- Automatically require Test::Unit and Rspec adapters
- ScenarioCreator strategy method chaining
- Removed mock_probe
- Removed stub_probe
- mock takes method_name argument
- stub takes method_name argument
- mock_probe takes method_name argument
- stub_probe takes method_name argument
- probe takes method_name argument
- dont_allow takes method_name argument
- do_not_allow takes method_name argument
- Space#doubles key is now the object id
- Fixed [#12402] Stubbing return value of probes fails after calling the stubbed method two times
- Added RRMethods#rr_verify and RRMethods#rr_reset
- Fixed "singleton method bound for a different object"
- Doing Method aliasing again to store original method
- Added mock_probe
- Added stub_probe
- Probe returns the return value of the passed in block, instead of ignoring its return value
- Scenario#after_call returns the return value of the passed in block
- Not using method aliasing to store original method
- Renamed DoubleMethods to RRMethods
- Added RRMethods#mock_probe
- Fixed [#12333] Rebinding original_methods causes blocks not to work
- Introduced concept of Terminal and NonTerminal TimesCalledMatchers
- Doubles that can be called many times can be replaced
- Terminal Scenarios are called before NonTerminal Scenarios
- Error message tweaking
- Raise error when making a Scenarios with NonTerminal TimesMatcher Ordered
- Fixed [#12290] Scenario#returns with false causes a return value of nil
- Fixed bug where Creators methods are not removed when methods are defined on Object
- Fixed [#12289] Creators methods are not removed in Rails environment
- Fixed [#12287] AtLeastMatcher does not cause Scenario to be called
- Fixed [#12286] AnyArgumentExpectation#expected_arguments not implemented
- Added DoubleMethods#any_times
- Added Scenario#any_number_of_times
- TimesCalledError Message Formatted to be on multiple lines
- ScenarioNotFoundError Message includes all Scenarios for the Double
- ScenarioOrderError shows list of remaining ordered scenarios
- Fixed [#12194] Double#reset_doubles are not clearing Ordered Scenarios bug
- Added Space#reset
- Space#reset_doubles and Space#reset_ordered_scenarios is now protected
- Added Scenario#at_least
- Added Scenario#at_most
- [#12120] probe allows a the return value to be intercepted
- TimesCalledExpectation says how many times were called and how many times called were expected on error
- TimesCalledError prints the backtrace to where the Scenario was defined when being verified
- Error message includes method name when Scenario is not found
- Fixed issue where Double#placeholder_name issues when Double method name has a ! or ?
- Scenario#returns also accepts an argument
- Implemented Scenario#yields
- Trim the backtrace for Rspec and Test::Unit
- Rspec and Test::Unit integration fixes
- Initial Release