[rspec-devel] Fwd: Your message to rspec-users awaits moderator approval

Matt Aimonetti matt at aimonetti.net
Wed Mar 12 15:48:32 EDT 2008


I recently forked the swx on rails plugin to fix few issues
http://github.com/matta/swx-ruby/tree/master

One of my problem is that RSpec totally freaks out because of the following
code:

ActionController::Base.class_eval do
    def render_with_swx(options = nil, &block)
      if options.is_a?(Hash) && options.keys.include?(:swx)
        swf_bytecode = SwxAssembler.write_swf(
                         options[:swx],
                         params[:debug],
                         SwxGateway.swx_config['compression_level'],
                         params[:url],
                         SwxGateway.swx_config['allow_domain']
                       )
        send_data(swf_bytecode, :type => 'application/swf', :filename => '
data.swf')
      else
        render_without_swx(options, &block)
      end
    end
    alias_method_chain :render, :swx
end

The problem is that rspec_on_rails subclasses render and passes 3 arguments(
rspec_on_rails/lib/spec/rails/example/controller_example_group.rb:189:in
`render' ) when the usual render method only has 2 arguments.

That's obviously a major problem for me and I was wondering if there was a
workaround that issue.


Thanks,

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20080312/9e2f57d0/attachment.html 


More information about the rspec-devel mailing list