From 67b94799c27cc3214017627aede759c5c5a39189 Mon Sep 17 00:00:00 2001 From: Andrew White Date: Thu, 31 May 2012 17:18:25 +0100 Subject: Reduce warning messages when running Active Support tests Eliminate the warnings generated by redefining methods and constants. --- activesupport/lib/active_support/testing/performance/ruby.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/testing/performance/ruby.rb b/activesupport/lib/active_support/testing/performance/ruby.rb index 1104fc0a03..12aef0d7fe 100644 --- a/activesupport/lib/active_support/testing/performance/ruby.rb +++ b/activesupport/lib/active_support/testing/performance/ruby.rb @@ -18,6 +18,7 @@ module ActiveSupport end).freeze protected + remove_method :run_gc def run_gc GC.start end @@ -28,6 +29,7 @@ module ActiveSupport @supported = @metric.measure_mode rescue false end + remove_method :run def run return unless @supported @@ -39,6 +41,7 @@ module ActiveSupport @total = @data.threads.sum(0) { |thread| thread.methods.max.total_time } end + remove_method :record def record return unless @supported @@ -78,6 +81,7 @@ module ActiveSupport self.class::Mode end + remove_method :profile def profile RubyProf.resume yield @@ -86,6 +90,7 @@ module ActiveSupport end protected + remove_method :with_gc_stats def with_gc_stats GC::Profiler.enable GC.start -- cgit v1.2.3