[Rspec-devel] Patch that allows method definitions inside of a context

Brian Takita brian.takita at gmail.com
Sun Jul 9 21:06:35 EDT 2006


Hello,

I submitted a patch that allows you to define methods inside of the context
block rather than inside of the setup method block.
http://rubyforge.org/tracker/index.php?group_id=797&atid=3151

For example, this patch allows:

require File.dirname(__FILE__)  + '/../lib/spec'

context "Rspec allow you to define custom methods" do
  specify "Rspec should allow you to define methods" do
    a_method
    @a_method_called.should.be true
  end

  def a_method
    @a_method_called = true
  end
end

This patch also does not break the behaviour where methods can be defined
inside of the setup block.

Thank you,
Brian Takita
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060709/df6e6a7c/attachment.html 


More information about the Rspec-devel mailing list