Brian Hartin | 16 May 00:19
Gravatar

How to monkeypatch in a plugin


Hi all,

I'm working on a plugin that enables automatic profiling and
benchmarking for unit tests.  I need to monkeypatch
Test::Unit::TestSuite to redefine the run method.  Based on the example
I see at http://svn.jthopple.com/plugins/count_limit_associations, I
thought I should be able to simply open the class in question in
/lib/profile_tests.rb, e.g.

module Test
  module Unit
    class Suite
      def run
        puts "My Run Method Used"
        ...

In init.rb, I simply have

require 'profile_tests'

However, running my tests does not seem to use my definition of 'run'.
Am I missing something?

Thanks!

Brian
--

-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane