This project is archived and is in readonly mode.
[patch] IntegrationTest not propagating method_missing when appropriate
Reported by George Ogata | August 31st, 2009 @ 05:39 AM
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
Comments and changes to this ticket
-
CancelProfileIsBroken September 25th, 2009 @ 12:38 PM
- Tag changed from integration, patch, tested, testing to bugmash, integration, patch, tested, testing
-
Elomar França September 28th, 2009 @ 12:05 AM
- 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.
-
George Ogata October 1st, 2009 @ 03:42 AM
Thanks much, Elomar. I should get better about chasing up my tickets before they go stale... :-/
-
George Ogata November 29th, 2009 @ 08:50 PM
This patch has been merged - ticket can be closed.
Thanks!
-
Rizwan Reza February 12th, 2010 @ 12:46 PM
- Tag changed from bugmash, integration, patch, tested, testing to integration, patch, tested, testing
-
Rohit Arondekar June 15th, 2010 @ 12:16 PM
- State changed from new to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>