can some one recommend me to scala mocking framework that can mock singleton objects and also does not need to declare any annotations as such. Basically i need a mock frame work that would not make me force to change the existing code base.
Asked
Active
Viewed 703 times
1
-
Possible duplicate of [How to mock a Scala singleton object?](http://stackoverflow.com/questions/25293758/how-to-mock-a-scala-singleton-object) – danielnixon Apr 28 '17 at 02:15
-
@danielnixon that post says scalamock framework can not mock singleton/companion objects so suggest to change the design of the system. I can not change the design. The code that i want to mock is already in production.So i am looking for a framework that can mock singleton/companion objects – user119020 Apr 28 '17 at 02:41
-
There is no such framework/library for Scala, AFAIK. There are two such libraries for the Java language (JMockit and PowerMock), but they probably don't work well for Scala code. I would suggest to open a feature/enhancement request in the ScalaMock project. – Rogério Apr 28 '17 at 14:14
-
Just found an issue to add singleton mocking support to ScalaMock [already exists](https://github.com/paulbutcher/ScalaMock/issues/41). – Rogério Apr 28 '17 at 14:17