RSpec's context method is broken

Posted . Visible to the public.

RSpec's context (which is basically an alias for describe) takes over your whole application. No object may have its own context method, or you will always receive errors like

"No description supplied for example group declared on ~/project/app/..."

The easiest workarounds:

  • do not name any method context
  • use describe instead of context in your specs, and put this into your spec_helper.rb:\
    Spec::DSL::Main.class_eval do
    if method_defined? :context
    undef :context
    end
    end
Tobias Kraze
Last edit
Keywords
cucumber
License
Source code in this card is licensed under the MIT License.
Posted by Tobias Kraze to makandra dev (2010-09-24 14:56)