summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2016-02-13 16:12:48 +0100
committerKornelius Kalnbach <murphy@rubychan.de>2016-02-13 16:12:48 +0100
commit0b8c69cfb7a65bec04c44e58e5776e323d2aa1af (patch)
treefd81bf6229bfc0d173f5b744534a76b5c70eb440 /test
parent916711c9983483c39f9a68c29e21a0ed40004bd2 (diff)
parent0a1f500d524ff0fb5eeafef051ccbb641954a87a (diff)
downloadcoderay-paint-integration.tar.gz
Merge branch 'master' into paint-integrationpaint-integration
Diffstat (limited to 'test')
-rw-r--r--test/executable/suite.rb2
-rwxr-xr-xtest/functional/basic.rb4
-rwxr-xr-xtest/functional/examples.rb2
-rw-r--r--test/unit/debug.rb10
-rw-r--r--test/unit/tokens.rb9
5 files changed, 8 insertions, 19 deletions
diff --git a/test/executable/suite.rb b/test/executable/suite.rb
index d386f4b..997405c 100644
--- a/test/executable/suite.rb
+++ b/test/executable/suite.rb
@@ -14,7 +14,7 @@ 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
+ RUBY_COMMAND = 'ruby'
EXE_COMMAND =
if RUBY_PLATFORM === 'java' && `ruby --ng -e '' 2> /dev/null` && $?.success?
# use Nailgun
diff --git a/test/functional/basic.rb b/test/functional/basic.rb
index 3053b54..752d4ba 100755
--- a/test/functional/basic.rb
+++ b/test/functional/basic.rb
@@ -164,9 +164,7 @@ more code # and another comment, in-line.
end
end
assert_equal 'reserved', CodeRay::TokenKinds[:reserved]
- assert_warning 'Undefined Token kind: :shibboleet' do
- assert_equal false, CodeRay::TokenKinds[:shibboleet]
- end
+ assert_equal false, CodeRay::TokenKinds[:shibboleet]
end
class Milk < CodeRay::Encoders::Encoder
diff --git a/test/functional/examples.rb b/test/functional/examples.rb
index 15f9ca3..985ef87 100755
--- a/test/functional/examples.rb
+++ b/test/functional/examples.rb
@@ -114,7 +114,7 @@ Token Types (7):
# format the tokens
term = terminal_encoder.encode_tokens(tokens)
- assert_equal "\e[1;31mimport\e[0m \e[33mthis\e[0m; \e[37m# The Zen of Python\e[0m", term
+ assert_equal "\e[32mimport\e[0m \e[31mthis\e[0m; \e[1;30m# The Zen of Python\e[0m", term
# re-using scanner and encoder
ruby_highlighter = CodeRay::Duo[:ruby, :div]
diff --git a/test/unit/debug.rb b/test/unit/debug.rb
index f2b80bd..88baf56 100644
--- a/test/unit/debug.rb
+++ b/test/unit/debug.rb
@@ -18,15 +18,15 @@ class DebugEncoderTest < Test::Unit::TestCase
[:begin_group, :string],
['test', :content],
[:end_group, :string],
- [:begin_line, :test],
+ [:begin_line, :head],
["\n", :space],
["\n \t", :space],
[" \n", :space],
["[]", :method],
- [:end_line, :test],
+ [:end_line, :head],
].flatten
TEST_OUTPUT = <<-'DEBUG'.chomp
-integer(10)operator((\\\))string<content(test)>test[
+integer(10)operator((\\\))string<content(test)>head[
method([])]
@@ -62,10 +62,10 @@ method([])]
[:begin_group, :string],
['test', :content],
[:end_group, :string],
- [:begin_line, :test],
+ [:begin_line, :unknown],
["\n\n \t \n", :space],
["[]", :method],
- [:end_line, :test],
+ [:end_line, :unknown],
].flatten
def test_filtering_text_tokens
diff --git a/test/unit/tokens.rb b/test/unit/tokens.rb
index 86dc632..73b0fd5 100644
--- a/test/unit/tokens.rb
+++ b/test/unit/tokens.rb
@@ -18,15 +18,6 @@ class TokensTest < Test::Unit::TestCase
assert_equal tokens.count, 4
end
- def test_dump_undump
- tokens = make_tokens
- tokens2 = nil
- assert_nothing_raised do
- tokens2 = tokens.dump.undump
- end
- assert_equal tokens, tokens2
- end
-
def test_to_s
assert_equal 'string()', make_tokens.to_s
end