Ecosyste.ms: OpenCollective
An open API service for software projects hosted on Open Collective.
github.com/freerange/mocha
A mocking and stubbing library for Ruby
https://github.com/freerange/mocha
PR: #420
Closes #414.
Co-authored-by: Nitish Rathi <[email protected]>
65b94a35e6aabd69cc13b8586eb85c9ca4fc0bad authored about 5 years ago by James Mead <[email protected]>
This allows us to remove the slightly ugly default argument for
Expectation#invoke.
In preparation for passing Invocation instance to Expectation#invoke.
077e8578f7f617ab19fd6d4931118a9381e8f7e0 authored about 5 years ago by Nitish Rathi <[email protected]>In preparation for extracting an `invoke` helper method.
40e7e351b74d709ed24b033436ee9d57490ea608 authored about 5 years ago by Nitish Rathi <[email protected]>This makes the relationship with Expectation#times clearer.
d7fb22434ac60463ea5327f6f82f82232540963a authored about 5 years ago by Nitish Rathi <[email protected]>
The names of these tests imply that the intention is that the method
name should match (i.e. sho...
RUBY_PLATFORM doesn't necessarily end with $, as it may include a minor
version number (e.g. x86...
Fix test failures on Mac OSX Catalina
a0c8bc7b7c78938b331dceb5c8cb8466c27a7dd9 authored about 5 years ago by James Mead <[email protected]>
This might be overly conservative, because I know the tests worked
without this exclusion on Mac...
95504cc74b7697378704c2857e0ceb4bf4111985 authored about 5 years ago by James Mead <[email protected]>
9add8ea93edd14741970b5867a4d4148bc0f70b4 authored about 5 years ago by James Mead <[email protected]>
By explicitly disabling 4 violations.
e95716ae629255816fe80b3ca79416d859aeeb3b authored about 5 years ago by James Mead <[email protected]>By explicitly disabling the cop for 4 violations.
d19f85335488e3c36d43e58c923518d622593825 authored about 5 years ago by James Mead <[email protected]>a3bdc518f74e11b48ca78e5c832c9651987e8cef authored about 5 years ago by James Mead <[email protected]>
By explicitly disabling 2 violations.
d6ddf3658e6717540821ff8b511da8814f652c2d authored about 5 years ago by James Mead <[email protected]>By explicitly disabling cop for one violation.
09a6847ac2dba2545bcb545add0ceae931713b23 authored about 5 years ago by James Mead <[email protected]>2a1240e6ad7bfacd36060c2043f0c2e3f49d2e68 authored about 5 years ago by James Mead <[email protected]>
aa10e0a8ec9e4b2a98cbd8e3c0883d8972756255 authored about 5 years ago by James Mead <[email protected]>
Explicitly disable cop for the one violation. This should avoid any
other long modules appearing.
I'm happy not having class/module level documentation comments.
d4edb1ced3c5baf2cf28f641440c0de1c4d5c51f authored about 5 years ago by James Mead <[email protected]>I generated this using the following command:
$ rubocop --auto-gen-config
aa16ea67b702b69c2af4cb200f9cda01789709fa authored about 5 years ago by James Mead <[email protected]>JRuby v9.2.9.0 was released at the end of Oct 2019 [1].
[1]: https://www.jruby.org/2019/10/30/j...
eb061c53faa31926a19cab9eb82e091798b9964e authored about 5 years ago by James Mead <[email protected]>These are the latest point releases of Ruby.
18cb1a93a56cffc632a3211e752ed0c9ec4f82da authored about 5 years ago by James Mead <[email protected]>PR: #412
Closes #405.
a66b7bede17cd7e4f7dc185b9e9b1bac86b3eabb authored about 5 years ago by Nitish Rathi <[email protected]>PR: #411
Closes #408 and #409.
Co-authored-by: Nitish Rathi <[email protected]>
c3d8b999350db9a35bc71c86b57e7019f0a4e81f authored about 5 years ago by James Mead <[email protected]>a6850d999e0623334242fba9098058d59a815647 authored about 5 years ago by Nitish Rathi <[email protected]>
a92cdc2ff0553d273547d1f30d5d9f4b9db1d6ae authored about 5 years ago by Nitish Rathi <[email protected]>
To reduce duplication.
811dd80a965ee84527a79661ee6e923b0f893aa5 authored about 5 years ago by Nitish Rathi <[email protected]>ed506a9c45376635e3c5022a48b33a71edc1ac23 authored about 5 years ago by Nitish Rathi <[email protected]>
b32007aa22939227efa5daf555ae8cb186756f3b authored about 5 years ago by Nitish Rathi <[email protected]>
713facd39c268c508925049838fcedb9d8d75ae6 authored about 5 years ago by Nitish Rathi <[email protected]>
And remove the now redundant UnexpectedInvocation class.
5fdc3da07daf272b3edb98f23864ff91e1fd4aad authored about 5 years ago by Nitish Rathi <[email protected]>
Note that eventually the plan is to remove the UnexpectedInvocation
class entirely and so that's...
71fa281f2d452cc9e465e41432471c2e767aeb16 authored about 5 years ago by Nitish Rathi <[email protected]>
This is in preparation for passing Invocation to Expectation#invoke.
72f6401bbd719d86ef38728196790816e363faa0 authored about 5 years ago by Nitish Rathi <[email protected]>
This is a small step towards pushing more logic into the Invocation
class.
44c78cefcf59edd538231121442f91d4ead84aae authored about 5 years ago by Nitish Rathi <[email protected]>
0deb490623be430ffc3a9b3c80b5536236850e17 authored about 5 years ago by Nitish Rathi <[email protected]>
9f654abe692dd5118fbcab91117769ab592282e1 authored about 5 years ago by Nitish Rathi <[email protected]>
c1b12d8b29f073c852791d47ea890a8c1d2806e0 authored about 5 years ago by Nitish Rathi <[email protected]>
This is a step towards encapsulating the arguments entirely within the
Invocation class.
4c24a3c1f3f0a5b5c4418865c6e6b0fe94611687 authored about 5 years ago by Nitish Rathi <[email protected]>
So move the instantiation of ParametersMatcher into that method.
ffb16e922272b23dcf2a940a3703b3bb63848bc5 authored about 5 years ago by James Mead <[email protected]>
This is in preparation for passing Invocation to ExpectationList
methods.
This also simplifies ...
a8f7d0ac1dc4fb1a7f5b4dcdbb2a9bce7bbaf5da authored about 5 years ago by Nitish Rathi <[email protected]>feb9c070f18406878df2b4dd2ce87070603ec189 authored about 5 years ago by James Mead <[email protected]>
Also handles Expectaction#throws scenario.
PR: #410
Second bunch of commits from #394.
Co-aut...
44708253962238e7ecfb14701c908f7a4a8ad6be authored about 5 years ago by James Mead <[email protected]>
This helps us avoid rescuing an exception raised by code elsewhere in
the Mocha code. Also, enab...
ad0fa3c12769a2c16bf6d4619308a1619c85524d authored about 5 years ago by Nitish Rathi <[email protected]>
09742f1829f4db7c1b27e7c7e202cf5b8c66e2f3 authored about 5 years ago by Nitish Rathi <[email protected]>
4a311184f94ace902490d3f588631327dbe55f1b authored about 5 years ago by Nitish Rathi <[email protected]>
e58de2b8bb0141d514deee322482bf09de590b92 authored about 5 years ago by Nitish Rathi <[email protected]>
expected hadn't quite sounded right because it also included allowed.
aa27319f18a95d6b40bd95644380caf0336b7b4c authored about 5 years ago by Nitish Rathi <[email protected]>Using more expressive & concise conditionals & booleans.
54f38b079e726ff44f9d4dcde9ebe7c81a1f2c13 authored about 5 years ago by Nitish Rathi <[email protected]>b6d10dc543fb7732f8ca819da31546c4f9bca4cd authored about 5 years ago by Nitish Rathi <[email protected]>
e20cb8a5f13926f43521f521a55e25586a4f5e15 authored about 5 years ago by Nitish Rathi <[email protected]>
f87bf6c42f9646a9b20b0a5b50bbb170138dfc02 authored about 5 years ago by Nitish Rathi <[email protected]>
290f390ebdd5398c6188671d213317d96fe2316a authored about 5 years ago by Nitish Rathi <[email protected]>
The target is to encapsulate it inside Cardinality in a tell-don't-ask
style.
The target is to encapsulate it inside Cardinality in a tell-don't-ask
style.
Cardinality and invocations go hand-in-hand. So, the target is to move
invocations to Cardinality.
Cardinality and invocations go hand-in-hand. So, the target is to move
invocations to Cardinality.
First bunch of commits from #394.
Co-authored-by: Nitish Rathi <[email protected]>
00f05402960995d3f8c3ac91023ed45a3e1600c6 authored about 5 years ago by James Mead <[email protected]>
Extract the assert_invocations method. Checking that invocations follow
'satisfied expectations:...
Less state to maintain. Array#size is O(1), so should be fine
performance-wise.
The tests were helpful for test-driving, but not all are needed due to
overlap.
Previously the expected arguments were being displayed here (using
Expectation#method_signature)...
7a5fef9008dccadf7614326f04a1365483e8a513 authored about 5 years ago by James Mead <[email protected]>
976705cb41d7201e07bc1c3ce01036fea405a1bb authored about 5 years ago by Nitish Rathi <[email protected]>
This will allow the yields to be captured and remembered by the invocation
2a79b6cd74193b031c36cf55da223f09ccdc41cc authored about 5 years ago by Nitish Rathi <[email protected]>
Since an expectation can have multiple matching invocations, and an invocation
can yield multipl...
a9f16a80ab6a1ed1f4453dceb005f121a053344b authored about 5 years ago by Nitish Rathi <[email protected]>
7f944998bb998a9ffd21e4f155451d169fe4134a authored about 5 years ago by Nitish Rathi <[email protected]>
Distinguish different ObjectMethods modules
8536868997be05477a0f2696ddc02370d114fd5f authored about 5 years ago by James Mead <[email protected]>
Previously this Mocha::ObjectMethods module was re-opening the module
defined in `lib/mocha/obje...
Previously this Mocha::ObjectMethods module was re-opening the module
defined in `lib/mocha/obje...
Do not include method definer into all objects
cc85f7c0eb652929adbf1d506f7315ccccea7b4e authored about 5 years ago by James Mead <[email protected]>Instead we pass the object into the three MethodDefiner methods.
0da9fd49688d6699abc40e1bcff53dd62d589d6d authored about 5 years ago by James Mead <[email protected]>
Since this module is not used within the library itself, there's no need
to include it within th...
This should help avoid confusion with the Mocha::ObjectMethods module
defined within the library...
4498dc9e1cca225518e0e19695713f48f4efaa14 authored about 5 years ago by James Mead <[email protected]>
By forcing people to require the explicit integrations for Test::Unit or
Minitest, we will be ab...
f04d4377bfd7398a3f238fda9fabd1b70e547100 authored about 5 years ago by Nitish Rathi <[email protected]>
These were not namespaced and it turns out they aren't actually tested
in the build.
9020248aae00303885dc6804be832714b7ddab47 authored about 5 years ago by Nitish Rathi <[email protected]>
This is a deprecation warning for the moment, but it would be good to
fail fast by raising an ex...
It's useful for the Mocha documentation to point out the different types of Test
Double and that...
Introduce stubba_class method as part of the contract between Mockery and the
object being stubbed.
3bac52c52f8deb3b248a8d6aebf1b821a7ffbe30 authored about 5 years ago by Nitish Rathi <[email protected]>
PR: #382 by @nitishr
e9e117e6daf5bbf3e08ed7511ede4df2c6d612bf authored about 5 years ago by James Mead <[email protected]>
Adding a new test triggers Metrics/ClassLength: Class has too many lines. So,
inlining the expec...
This is more reasonable and realistic than yielding only if a block is given.
A stub that's set ...
PR: #370 by @nitishr
Closes #270
Closes #362
Since original_method_owner is a class, it can already provide method_visibility
(through ClassM...
3c4e94f74a29a74e9319dd8b430b7e45712d4e81 authored about 5 years ago by Nitish Rathi <[email protected]>
on_stubbing_method_unnecessarily differs only in how the method_signature and
backtrace are comp...
It was originally extracted to please rubocop, as it complained about cyclomatic
complexity bein...
e83d0ff56537369178c2d321eed12c44c79f392b authored about 5 years ago by Nitish Rathi <[email protected]>
bf79f3b487adc97b4968aa321b4070b249fc5723 authored about 5 years ago by Nitish Rathi <[email protected]>
ca58f1289e5e8a861ff5b8878c4f48e02e1a1c6e authored about 5 years ago by Nitish Rathi <[email protected]>
0d9400dadd8b40fe7b939505d0f091160e8f3281 authored about 5 years ago by Nitish Rathi <[email protected]>