search for: acts_as_test

Displaying 2 results from an estimated 2 matches for "acts_as_test".

2007 Nov 27
1
Plugin - How to access object from instance method
Quick question: Given a basic plugin... how can I access an object that I instantiated in the acts_as method from an instance method? Probably some sort of accessor... but where? def self.included(base) base.extend ClassMethods end module ClassMethods def acts_as_test object = Object.new ## This object needs to be accessible from the Instance Methods end include Acts::As::Test::InstanceMethods end module InstanceMethods def do_something return object.process ## object created in acts_as_test end end -- Posted via http://www.ruby-forum.com/. -...
2006 Jun 13
3
Dynamic determination of class under test...
I''ve been developing a series of custom assertions for testing my models and it looks like I can unify most some of the assertions if I can find a good way to determine the class under test at run-time. Now I refactor my test code rather vigorously so its not as simple as just stripping "Test" off the name of the test case class, but I have a few thoughts on a useful convention