]> source.dussan.org Git - redmine.git/commitdiff
use "skip" instead of "if statement" whether Redcarpet is installed at markdown_forma...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 30 Nov 2020 15:49:44 +0000 (15:49 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 30 Nov 2020 15:49:44 +0000 (15:49 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20531 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/lib/redmine/wiki_formatting/markdown_formatter_test.rb

index 40be18646e9549f71e5ac475d0a4dfdbfcac705f..b3c53accac4b994171960668e00c26efbaa6fc11 100644 (file)
 require File.expand_path('../../../../../test_helper', __FILE__)
 
 class Redmine::WikiFormatting::MarkdownFormatterTest < ActionView::TestCase
-  if Object.const_defined?(:Redcarpet)
-
   def setup
+    unless Object.const_defined?(:Redcarpet)
+      skip "Redcarpet is not installed"
+    end
     @formatter = Redmine::WikiFormatting::Markdown::Formatter
   end
 
@@ -194,5 +195,4 @@ class Redmine::WikiFormatting::MarkdownFormatterTest < ActionView::TestCase
     assert_equal expected, result.first, "section content did not match"
     assert_equal Digest::MD5.hexdigest(expected), result.last, "section hash did not match"
   end
-  end
 end