aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2012-05-31 17:18:25 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2012-05-31 17:18:25 +0100
commit67b94799c27cc3214017627aede759c5c5a39189 (patch)
treee3baef5883b73940af5fc37abda32bedd0ad13e0 /activesupport
parent5752b313ec63cf7015f165b28aac1d7938274c13 (diff)
downloadrails-67b94799c27cc3214017627aede759c5c5a39189.tar.gz
rails-67b94799c27cc3214017627aede759c5c5a39189.tar.bz2
rails-67b94799c27cc3214017627aede759c5c5a39189.zip
Reduce warning messages when running Active Support tests
Eliminate the warnings generated by redefining methods and constants.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/testing/performance/ruby.rb5
-rw-r--r--activesupport/test/core_ext/kernel_test.rb5
2 files changed, 8 insertions, 2 deletions
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
diff --git a/activesupport/test/core_ext/kernel_test.rb b/activesupport/test/core_ext/kernel_test.rb
index e90b9d454f..99e4506be7 100644
--- a/activesupport/test/core_ext/kernel_test.rb
+++ b/activesupport/test/core_ext/kernel_test.rb
@@ -96,15 +96,16 @@ class KernelDebuggerTest < ActiveSupport::TestCase
end
def test_debugger_not_available_message_to_rails_logger
+ Object.send(:remove_const, :Rails) if Object.const_defined?(:Rails)
rails = Class.new do
def self.logger
@logger ||= MockStdErr.new
end
end
- Object.const_set("Rails", rails)
+ Object.const_set(:Rails, rails)
debugger
assert_match(/Debugger requested/, rails.logger.output.first)
ensure
- Object.send(:remove_const, "Rails")
+ Object.send(:remove_const, :Rails)
end
end