Search code examples
rubyminitest

Can I define own behavior of a mock method with Minitest?


Is it possible to define own behavior of mock method using Minitest? I have found only solutions like "if called A return B", but I'd like to define own, alternative behavior in some block or lambda. Is it possible?


Solution

  • minitest/mock does have a block expectation feature, have you tried it?