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

aslak hellesoy aslak.hellesoy at gmail.com
Sun Jul 9 22:54:09 EDT 2006


Great stuff Brian - you're a metaprogramming whiz!

I'd like to apply this patch, what do you others think?

Aslak

On 7/9/06, Brian Takita <brian.takita at gmail.com> wrote:
> 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
>
> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>
>


More information about the Rspec-devel mailing list