From 4f106bbb2ccbcfb54865bdca786b9fb0ee669032 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 18 Oct 2012 12:04:51 -0700 Subject: some ruby interpreters don't have ruby-prof so just skip the tests rather than exiting the process. --- activesupport/test/testing/performance_test.rb | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'activesupport/test/testing/performance_test.rb') diff --git a/activesupport/test/testing/performance_test.rb b/activesupport/test/testing/performance_test.rb index 53073cb8db..6918110cce 100644 --- a/activesupport/test/testing/performance_test.rb +++ b/activesupport/test/testing/performance_test.rb @@ -1,10 +1,19 @@ require 'abstract_unit' -require 'active_support/testing/performance' - module ActiveSupport module Testing class PerformanceTest < ActiveSupport::TestCase + begin + require 'active_support/testing/performance' + HAVE_RUBYPROF = true + rescue LoadError + HAVE_RUBYPROF = false + end + + def setup + skip "no rubyprof" unless HAVE_RUBYPROF + end + def test_amount_format amount_metric = ActiveSupport::Testing::Performance::Metrics[:amount].new assert_equal "0", amount_metric.format(0) @@ -56,4 +65,4 @@ module ActiveSupport end end end -end \ No newline at end of file +end -- cgit v1.2.3