Feature Requests: Browse | Submit New | Admin

[#19786] Provide a useful error message when someone tries to use Mocha outside a test case

Date:
2008-04-26 14:23
Priority:
3
Submitted By:
James Mead (jamesmead)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Provide a useful error message when someone tries to use Mocha outside a test case

Detailed description
See posts to the mailing list [1, 2] from Ken Harris.

[1] http://rubyforge.org/pipermail/mocha-developer/2008-April/000546.html
[2] http://rubyforge.org/pipermail/mocha-developer/2008-April/000548.html

Add A Comment: Notepad

Please login


Followup

Message
Date: 2009-01-02 16:50
Sender: James Mead

This feature request has moved to Lighthouse [1].

[1] http://floehopper.lighthouseapp.com/projects/22289/tickets/11
Date: 2008-04-29 23:05
Sender: Ken Harris

Perhaps the easiest way to do it is to say:

  include Mocha::Standalone
  mocha_setup

The place to put the warning would be at the start of the
expects(symbol) method in object.rb.

For example:

  raise "You need to run 'include Mocha::Standalone; mocha_setup'
before using Mocha outside a TestCase" unless $stubba

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item