* Posting on behalf of James Mead ([EMAIL PROTECTED]) *
Sounds interesting. I've been doing my own monkey-patching recently
(http://mocha.rubyforge.org/classes/MultipleSetupAndTeardown.html) and
have noticed a couple of other people
In that case, the plugin won't help you, but it won't hinder you
either.
Francois Beausoleil wrote:
Hello Keith,
2006/8/17, Keith Morrison [EMAIL PROTECTED]:
Comments, questions, suggestions?
My tests are defined like this now:
#
Is there a reason we don't just create a new subclass of
Test::Unit::TestCase called ControllerTest (or FunctionalTest) and
inheirit from that instead? We don't have to worry about the magic and
it's still backwards compatible.
--
Kevin Clark
http://glu.ttono.us
Not without even more magic. Test::Unit::TestCase has an inherited
method that tries to build a test suite from any test_* methods in the
subclass.
Executing this code:
require 'test/unit'
class FunctionalTest Test::Unit::TestCase; end
Produces:
1) Failure:
default_test:2
No tests were
Rails does a great job of inferring a lot of things based on names, so
it seems like a good fit to me.
class User ActiveRecord::Base
has_many :assignments
end
From this class declaration, Rails infers that there is an Assignment
model that contains the foreign key user_id. Isn't this the
On 8/18/06, Keith Morrison [EMAIL PROTECTED] wrote:
You could define a fake test, but then the test and assertion count will
be off.
A simple:
def default_test
end
In your abstract test case will prevent the failure, and while you
will see an extra test, there will be no assertion
Hello Keith,
2006/8/17, Keith Morrison [EMAIL PROTECTED]:
Comments, questions, suggestions?
My tests are defined like this now:
# test/functional/admin_controller_test.rb
class UnauthenticatedAccessToAdminSectionTest Test::Unit::TestCase
def setup
@controller = AdminController.new