[rspec-devel] module-reference error (scoping?) on Rails 2.1.2

David Chelimsky dchelimsky at gmail.com
Thu Feb 12 00:42:43 EST 2009


On Tue, Feb 10, 2009 at 11:22 AM, Peter Fitzgibbons
<peter.fitzgibbons at gmail.com> wrote:
> HI All,
> Could you view this log http://pastie.org/384945
>
> This only fails on Rails 2.1.2.
> 2.3.0 and 2.2.2 pass.
>
> ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
>
> It looks like ruby + 2.1.2 is failing to properly execute the raise on these
> from
> example_rails_app/vendor/plugin/rspec_rails/spec/spec/resources/controllers/controller_spec_controller.rb
> (forgive any path typo... I wrote that from memory during editing)
>
>   def rescued_error_action
>     raise RescuedError
>   end
>
>   def other_error_action
>     raise UnRescuedError
>   end
>
> I tried changing the methods to this and pre_commit then runs successfully.
>   def rescued_error_action
>     raise ControllerSpecController::RescuedError
>   end
>
>   def other_error_action
>     raise ControllerSpecController::UnRescuedError
>   end
>
> Question to you : have you seen this?  Do you agree the change to
> rspec_rails spec/resources/controllers/controller_spec_controller.rb is
> reasonable to workaround teh brain-damaged Rails 2.1.2?
> Why would the original scoping fail in 2.1.2 yet pass in 2.2.2 and 2.3.0 ?
>
> Am I brain-damaged?

I'm pretty sure these are the same scoping rule changes we'll find in
1.9, so brain-damaged though it may be, it is not your brain.

Wanna send me a patch?

http://rspec.lighthouseapp.com

>
> Thanks for your help!
>
> Peter Fitzgibbons
> (847) 687-7646
> Email: peter.fitzgibbons at gmail.com
> IM GTalk: peter.fitzgibbons
> IM Yahoo: pjfitzgibbons
> IM MSN: pjfitzgibbons at hotmail.com
> IM AOL: peter.fitzgibbons at gmail.com
>
>
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel
>


More information about the rspec-devel mailing list