[rspec-devel] Monkey patch for Test::Rails with latest Edge Rails

Trotter Cashion trotter at eastmedia.com
Wed Nov 15 12:57:41 EST 2006


Oh, remove "< ViewTestCase.superclass" if you want. That's just me  
doing stupid stuff and playing around.

- Trotter

On Nov 15, 2006, at 12:25 PM, Trotter Cashion wrote:

> Everyone,
>
> The latest version of Edge Rails raises an error when deprecated
> instance variables are set. Test::Rails touches @session when
> rendering views, causing specs to blow up. Put the monkey patch below
> into your spec_helper to fix this problem. I'm posting it on this
> list because I don't know when this will be patched in Test::Rails,
> and I figure some of you may run into this error soon.
>
> in spec/spec_helper.rb
>
> module Test
>    module Rails
>      class ViewTestCase < ViewTestCase.superclass
>        attr_reader :session
>        alias_method :setup_with_session_instance_variable, :setup
>        def setup
>          setup_with_session_instance_variable
>          @controller.send(:remove_instance_variable,  
> "@session".to_sym)
>          @session = @controller.session
>        end
>      end
>    end
> end
>
> - Trotter
> _______________________________________________
> rspec-devel mailing list
> rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel



More information about the rspec-devel mailing list