1

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?

Amir
  • 9,091
  • 5
  • 34
  • 46
lulalala
  • 17,572
  • 15
  • 110
  • 169

1 Answers1

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:

nemesv
  • 138,284
  • 16
  • 416
  • 359
  • 3
    I'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