RSpec's context method is broken

Updated . 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
    
Profile picture of Tobias Kraze
Tobias Kraze
Last edit
Dominik Schöler
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)