提交 4f106bbb 编写于 作者: A Aaron Patterson

some ruby interpreters don't have ruby-prof so just skip the tests

rather than exiting the process.
上级 11acaa17
......@@ -2,7 +2,7 @@
require 'ruby-prof'
rescue LoadError
$stderr.puts 'Specify ruby-prof as application\'s dependency in Gemfile to run benchmarks.'
exit
raise
end
module ActiveSupport
......
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 @@ def test_environment_format_with_rails
end
end
end
end
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册