diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-18 12:04:51 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-10-18 12:04:51 -0700 |
commit | 4f106bbb2ccbcfb54865bdca786b9fb0ee669032 (patch) | |
tree | 3e08a545264b32c21810d4f54c5161b11ee9d28e /activesupport/test/testing | |
parent | 11acaa172c73c5d1787184ef5545df358027462c (diff) | |
download | rails-4f106bbb2ccbcfb54865bdca786b9fb0ee669032.tar.gz rails-4f106bbb2ccbcfb54865bdca786b9fb0ee669032.tar.bz2 rails-4f106bbb2ccbcfb54865bdca786b9fb0ee669032.zip |
some ruby interpreters don't have ruby-prof so just skip the tests
rather than exiting the process.
Diffstat (limited to 'activesupport/test/testing')
-rw-r--r-- | activesupport/test/testing/performance_test.rb | 15 |
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 |