Skip to content

Conversation

@DarrenBishop
Copy link
Contributor

The new withObjectSpied[...] works almost the same as withObjectMocked[...] e.g. they are both strict by default, but with the following differences:

Static singleton objects are already complete w.r.t to implementation, so the behaviour proposed here is for real methods to be called; this allows slight tweaks in its original behaviour, rather than having to reimplement in stubs.
Otherwise, withObjectMocked[...] can still be used.

Leniency settings are made available via an implicit parameters, with strict semantics enabled by default i.e. implicitly.
I did want to spend more time looking into some leniency-related enums I saw during this work, but thought get the PR out sooner rather than later, as it currently works.
@bbonanno do you think there is some de-duplication that can be done in this area?

Finally re: the version parsing, I wanted to try these changes on some code I am working on for my client;publishLocal is annoying development-loop, when working across projects. I tried to use the following in my client build.sbt:

lazy val scalatest = ProjectRef(file("../../OSS/mockito-scala"), "scalatest")

This however lead to errors locating the version.properties file; the changes seem to fix that. I can remove if it is considered undesirable, give also the creation of project/Helpers.scala

@DarrenBishop DarrenBishop force-pushed the feature/Introduce_object_spying_for_call_real_method_default_behaviour branch from d59747f to 765aa3a Compare August 5, 2021 13:43
@DarrenBishop DarrenBishop marked this pull request as ready for review August 5, 2021 14:32
@DarrenBishop DarrenBishop force-pushed the feature/Introduce_object_spying_for_call_real_method_default_behaviour branch 2 times, most recently from 8ba0a2c to 00a51cf Compare August 5, 2021 15:19
@DarrenBishop DarrenBishop force-pushed the feature/Introduce_object_spying_for_call_real_method_default_behaviour branch 3 times, most recently from 3521617 to 79f92a4 Compare August 13, 2021 11:17
@ultrasecreth
Copy link
Member

@DarrenBishop pls rebase, the HEAD of the release/1.x branch has the fix for CI

…ion.properties` file, when referencing this project i.e. `mockito-scala`, from another project in the developer's workspace
  1. Includes auto-verification within a session for unnecessary stubs; strictness is applied by default via implicits
  2. Proof that real methods are called when not stubbed
@DarrenBishop DarrenBishop force-pushed the feature/Introduce_object_spying_for_call_real_method_default_behaviour branch from 79f92a4 to 79c97ba Compare August 16, 2021 07:36
@ultrasecreth ultrasecreth merged commit 398e0f2 into mockito:release/1.x Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants