aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/testing/performance_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/test/testing/performance_test.rb')
-rw-r--r--activesupport/test/testing/performance_test.rb15
1 files changed, 12 insertions, 3 deletions
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