#211 open
David Chelimsky

Ruby 1.9 - helper methods aren't recognized when example group is nested in a module

Reported by David Chelimsky | December 29th, 2007 @ 05:18 AM

This example can be found in rspec/examples/pure/helper_method_example.rb in trunk (r3205):

module HelperMethodExample
  describe "an example group with helper a method" do
    def helper_method
      "received call"
    end
  
    it "should make that method available to specs" do
      helper_method.should == "received call"
    end
  end
end

Running against 1.8.6 produces:

.

Finished in 0.005994 seconds

1 example, 0 failures

Running against Ruby 1.9 produces:

F

1)
NameError in 'an example group with helper a method should make that method available to specs'
undefined local variable or method `helper_method' for #<Spec::Example::ExampleGroup::Subclass_1:0x3cc33c>
examples/pure/helper_method_example.rb:10:in `block (2 levels) in <module:HelperMethodExample>'

Finished in 0.012416 seconds

1 example, 1 failure

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket

Tags