I am writing an Nspec to test some file manipulation. I want to be able to intercept the call just before renaming the file, and I thought something similar to Rspec's should_receive should do. However I can't find anything like that in the Nspec documentations. Is there a equivalent in Nspec?
Asked
Active
Viewed 514 times
1 Answers
3
The short answer is No.
Nspec is a BDD testing framework without any Mocking/Stubbing capability. If you want to use something like should_receive
in rspec you need to use one of the many mocking frameworks in .net.
Some options:
- Rhino Mocks
- Moq
- Isolator .NET (not free, but richer features)
- JustMock (not free, but richer features)

nemesv
- 138,284
- 16
- 416
- 359
-
3I'd also recommend NSubstitute. Its been pretty great so far. – Grummle Apr 25 '12 at 04:31
-
+1, we didn't see the need to add a dedicated mocking framework or assertion framework. There are plenty of good ones out there -Amir (Hacker on NSpec) – Amir Aug 11 '12 at 13:59