[rspec-users] Rails Rendering diagnostics.rhtml in Controller Spec

David Chelimsky dchelimsky at gmail.com
Wed May 23 18:26:17 EDT 2007


On 5/23/07, Ryan Bates <bates.ryan at gmail.com> wrote:
> I got it working by placing this in the spec_helper.rb:
>
> ---
> Spec::Runner.configure do |config|
>   config.before(:each) do
>     unless @controller_class_name.blank?
>       @controller_class_name.constantize.class_eval do
>         define_method :rescue_action do |e|
>           raise e
>         end
>       end
>     end
>   end
> end

Nice job getting it working. We probably need something that would support this:

Spec::Runner.configure do |config|
 config.define_controller_rescue_action {|e| raise e}
end

I'm not in love w/ exactly that - but something like that. Any suggestions?



> ---
>
> I'm sure accessing the @controller_class_name instance variable
> directly like that isn't a good thing, but it seems to work. If anyone
> knows of a better way please reply. :)



>
> Thanks again,
>
> Ryan
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>


More information about the rspec-users mailing list