In 2.13.0 only `and_yield` and `and_return` could be combined, since that was the only combination case that was specified by an example. This was a regression, as reported by a user in #230. I tried here to fully specify all of the various combinations of stub actions. Notes: * `and_return`, `and_raise` and `and_throw` are "terminal" actions in the sense that they terminate the method. They _must_ happen last and it is impossible to support more than one of these. Hence, we allow only one of these, and allow them to be overridden. We also return `nil` from these methods to discourage further stub configuration. * `and_call_original` is a special case that doesn't make sense to be combined with any of the others. Once you've set it up, this causes any further instructions to raise an error. * `and_yield` is treated as an "initial" action. Yielding doesn't exit a method the way the terminal actions do. It is the only initial action. Calling it multiple times sets up multiple yields. * Setting a block implementation (possible by passing a block to almost any method on the fluent interface) sets the block as the "inner" action. It runs between the configured yields (if there are any) and the configured terminal action (if there is one). My thinking here is that in many cases, users use a block implementation to specify a return value, essentially making it like a terminal action (so it should come after the `and_yield` actions), but in other cases, the user may just use a block for a side effect, and may configure an terminal action as well. Only one block implementation is supported and it can be overridden.
Fix travis CI build. - Bundler 1.3 needs rbconfig to be required to run `bin/rspec` after installing with `--standalone --binstubs`. bundler/bundler#2382 - The Travis VMs no longer have 32-bit JVMs available. Aruba 0.4.11 forced the -d32 flag. 0.5 just documents it and makes a file available to require that will set it. We've updated Aruba here so that the jruby ENV vars aren't set automatically; we've kept the flag to disable JIT but removed -d32.
… bizare issue with dup and frozen
…receive. Fixes #228.
My last fix did not properly simulate SimpleDelegator since it mixes in a dup of Kernel and not Kernel itself. This actually fixes it, and I also fixed `and_call_original` (which suffered from the same bug) for this case as well.
It's not in Ruby < 1.9.
…ses. Fixes #219.