FlexMock是一个比较流行的针对Rails单元测试的Mock工具,
安装方法:$ gem install flexmock
FlexMock 0.9.0 增加了使用 when() 的状态机支持,其他方面改进还包括:
- It makes expectations fail as soon as the number of expected calls is exceeded.
- flexmock_teardown no longer returns a function.
同时还修复了一些 bug:
- fixes should_call(), allowing it on class and static methods while disallowing on class mocks.
- fixes Unicode argument handling issues.
- fixes issues with @property methods misbehaving in the debugger.
- fixes pytest integration and instance teardown.
- fixes private method handling
FlexMock下载地址请点这里
