Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[patch] IntegrationTest not propagating method_missing when appropriate

#3119

AC::IntegrationTest:

  • derives from AS::TestCase.
  • has a method_missing which delegates methods to its Session object.
  • does not propagate the method_missing to its superclass if the Session object does not respond_to? the method.

This kills RSpec's IntegrationExampleGroup, as RSpec implements matchers like be_* via method_missing by mixing its Matchers module into AS::TestCase. I consider this to be a bug in IntegrationTest--it should propagate method_missing to its superclass if the session object can't handle it. Patch attached.

To reproduce the issue:

gem install rails rspec-rails
rails testapp
cd testapp
script/generate rspec
mkdir spec/integration
$EDITOR spec/integration/integration_spec.rb

Add the following:

require 'spec/spec_helper'

describe "Integration example groups", :type => :integration do
  it "should have RSpec matchers available" do
    true.should be_true
  end
end

Then:

rake db:migrate
rake spec:integration

Reported by George Ogata · August 31st, 2009 @ 05:39 AM

State: resolved
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from integration, patch, tested, testing to bugmash, integration, patch, tested, testing

    September 25th, 2009 @ 12:38 PM

  2. Elomar França
    Elomar França
    • Title changed from IntegrationTest not propagating method_missing when appropriate to [patch] IntegrationTest not propagating method_missing when appropriate

    +1, I think method_missing should propagate.

    I've attached a patch fixing the path.

    September 28th, 2009 @ 12:05 AM

  3. George Ogata
    George Ogata

    Thanks much, Elomar. I should get better about chasing up my tickets before they go stale... :-/

    October 1st, 2009 @ 03:42 AM

  4. ronin-278 (at lighthouseapp)
  5. George Ogata
    George Ogata

    This patch has been merged - ticket can be closed.

    Thanks!

    November 29th, 2009 @ 08:50 PM

  6. Rizwan Reza
    Rizwan Reza
    • Tag changed from bugmash, integration, patch, tested, testing to integration, patch, tested, testing

    February 12th, 2010 @ 12:46 PM

  7. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to resolved

    June 15th, 2010 @ 12:16 PM