diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/executable/suite.rb | 5 | ||||
-rwxr-xr-x | test/functional/examples.rb | 4 | ||||
-rw-r--r-- | test/functional/for_redcloth.rb | 14 | ||||
-rwxr-xr-x | test/unit/plugin.rb | 5 |
4 files changed, 10 insertions, 18 deletions
diff --git a/test/executable/suite.rb b/test/executable/suite.rb index f3495d6..d386f4b 100644 --- a/test/executable/suite.rb +++ b/test/executable/suite.rb @@ -14,12 +14,13 @@ class TestCodeRayExecutable < Test::Unit::TestCase ROOT_DIR = Pathname.new(File.dirname(__FILE__)) + '..' + '..' EXECUTABLE = ROOT_DIR + 'bin' + 'coderay' + RUBY_COMMAND = RUBY_VERSION < '2.0.0' ? 'ruby -w' : 'ruby' # Ruby 2 currently throws warnings for bundler EXE_COMMAND = if RUBY_PLATFORM === 'java' && `ruby --ng -e '' 2> /dev/null` && $?.success? # use Nailgun - 'ruby --ng -wI%s %s' + "#{RUBY_COMMAND}--ng -I%s %s" else - 'ruby -wI%s %s' + "#{RUBY_COMMAND} -I%s %s" end % [ROOT_DIR + 'lib', EXECUTABLE] def coderay args, options = {} diff --git a/test/functional/examples.rb b/test/functional/examples.rb index ff64af3..15f9ca3 100755 --- a/test/functional/examples.rb +++ b/test/functional/examples.rb @@ -22,7 +22,7 @@ end CODE assert_equal <<-DIV, div <table class="CodeRay"><tr> - <td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre><a href="#n1" name="n1">1</a> + <td class="line-numbers"><pre><a href="#n1" name="n1">1</a> <a href="#n2" name="n2">2</a> <a href="#n3" name="n3">3</a> </pre></td> @@ -38,7 +38,7 @@ end <body> <table class="CodeRay"><tr> - <td class="line-numbers" title="double click to toggle" ondblclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre> + <td class="line-numbers"><pre><a href="#n1" name="n1">1</a> </pre></td> <td class="code"><pre>puts <span class="string"><span class="delimiter">"</span><span class="content">Hello, world!</span><span class="delimiter">"</span></span></pre></td> </tr></table> diff --git a/test/functional/for_redcloth.rb b/test/functional/for_redcloth.rb index e980667..9fd244e 100644 --- a/test/functional/for_redcloth.rb +++ b/test/functional/for_redcloth.rb @@ -1,5 +1,4 @@ require 'test/unit' -require File.expand_path('../../lib/assert_warning', __FILE__) $:.unshift File.expand_path('../../../lib', __FILE__) require 'coderay' @@ -66,19 +65,14 @@ class BasicTest < Test::Unit::TestCase # See http://jgarber.lighthouseapp.com/projects/13054/tickets/124-code-markup-does-not-allow-brackets. def test_for_redcloth_false_positive require 'coderay/for_redcloth' - assert_warning 'CodeRay::Scanners could not load plugin :project; falling back to :text' do - assert_equal '<p><code>[project]_dff.skjd</code></p>', - RedCloth.new('@[project]_dff.skjd@').to_html - end + assert_equal '<p><code>[project]_dff.skjd</code></p>', + RedCloth.new('@[project]_dff.skjd@').to_html # false positive, but expected behavior / known issue assert_equal "<p><span lang=\"ruby\" class=\"CodeRay\">_dff.skjd</span></p>", RedCloth.new('@[ruby]_dff.skjd@').to_html - assert_warning 'CodeRay::Scanners could not load plugin :project; falling back to :text' do - assert_equal <<-BLOCKCODE.chomp, + assert_equal <<-BLOCKCODE.chomp, RedCloth.new('bc. [project]_dff.skjd').to_html <pre><code>[project]_dff.skjd</code></pre> - BLOCKCODE - RedCloth.new('bc. [project]_dff.skjd').to_html - end + BLOCKCODE end end if defined? RedCloth
\ No newline at end of file diff --git a/test/unit/plugin.rb b/test/unit/plugin.rb index a1d06e1..41eec51 100755 --- a/test/unit/plugin.rb +++ b/test/unit/plugin.rb @@ -1,6 +1,5 @@ require 'test/unit' require 'pathname' -require File.expand_path('../../lib/assert_warning', __FILE__) $:.unshift File.expand_path('../../../lib', __FILE__) require 'coderay' @@ -39,9 +38,7 @@ class PluginScannerTest < Test::Unit::TestCase def test_default assert_nothing_raised do - assert_warning 'PluginScannerTest::PluginsWithDefault could not load plugin :gargamel; falling back to :default_plugin' do - assert_operator PluginsWithDefault[:gargamel], :<, PluginsWithDefault::Plugin - end + assert_operator PluginsWithDefault[:gargamel], :<, PluginsWithDefault::Plugin end assert_equal PluginsWithDefault::Default, PluginsWithDefault.default end |