Closed dweebo closed 6 years ago
Yeah, we definitely don't want to use Mockito/etc. My guess is that writing tests for SpoonRule would be more effort than it's worth, given how entangled it all is with Android, but feel free to take a crack at it.
Just curious to hear why you are against Mockito? We use it heavily for our android tests and frequently mock out android classes. It is not fun but it works. Would love to hear a better alternative.
Mocking is a vehicle to coupling tests to implementation details. I prefer testing strategies which force good design instead of encourage coupling. For example, the use of fakes necessitate a design that allows dependencies to be swapped and discourages reliance on the order of things called (instead relying on emulated behavior and not caring how it's called).
On Thu, Oct 19, 2017, 9:46 PM CAH-peterhewitt notifications@github.com wrote:
Just curious to hear why you are against Mockito? We use it heavily for our android tests and frequently mock out android classes. It is not fun but it works. Would love to hear a better alternative.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/square/spoon/pull/485#issuecomment-338083414, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEUCBqQBZY3DUqdslmvLu4cyMPw5fks5st_tngaJpZM4P7dAK .
Thanks Jake, I agree with it coupling to implementation, we fight that quite a bit. Android just makes it so tough to do. Appreciate the response.
As discussed in #465
Basically just copied over code from old
Spoon.java
implementation w/ minor changes toSpoonRule
, and clear files from each device at the start of testing.Question: Should the code in
SpoonRule
have tests? I see we don't have Mockito or PowerMock so it would be difficult unless we move androidy stuff out to separate classes.