On Fri, Jul 23, 2010 at 6:46 PM, Lille <lille.pengu...@gmail.com> wrote: > Hi, > > I've been browsing the RSpec book and the RDoc, but I can't see how to > ensure the following: > > Stub an instance with a method it doesn't have and raise NoMethodError > (or something like it.)
RSpec doesn't support anything like that. I'm not sure if any of the Ruby frameworks do, though I've been involved with conversations about this sort of thing before. I wouldn't want behaviour like this myself unless it could be invoked explicitly with a command line argument, but was otherwise off. In other words, you could do something like: rspec spec --audit-stubbed-methods And then that would generate some sort of report. Feel free to submit a feature request to http://github.com/rspec/rspec-mocks if you're interested in pursuing such. Cheers, David > > I want to do this because I don't want to use incorrect names for my > dependency methods... > > Thanks, > > Lille > _______________________________________________ > rspec-users mailing list > rspec-users@rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users > _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users