summaryrefslogtreecommitdiff
path: root/tests/test_ruby.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2014-10-06 20:12:55 -0700
committerTim Hatch <tim@timhatch.com>2014-10-06 20:12:55 -0700
commit335ae1e0f099b523ed362734300a8bed1cc54a7e (patch)
treee330ddfba95d366064307810c993ecd4457ee3eb /tests/test_ruby.py
parentad76a6679d2092f197e4503e5ededffafb87983b (diff)
downloadpygments-335ae1e0f099b523ed362734300a8bed1cc54a7e.tar.gz
RubyLexer: Highlight operator methods better.
Fixes #1033
Diffstat (limited to 'tests/test_ruby.py')
-rw-r--r--tests/test_ruby.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_ruby.py b/tests/test_ruby.py
index 8420826e..9c6bc085 100644
--- a/tests/test_ruby.py
+++ b/tests/test_ruby.py
@@ -17,6 +17,7 @@ class RubyTest(unittest.TestCase):
def setUp(self):
self.lexer = RubyLexer()
+ self.maxDiff = None
def testRangeSyntax1(self):
fragment = u'1..3\n'
@@ -111,3 +112,14 @@ class RubyTest(unittest.TestCase):
]
self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
+ def testOperatorMethods(self):
+ fragment = u'x.==4\n'
+ tokens = [
+ (Token.Name, u'x'),
+ (Token.Operator, u'.'),
+ (Token.Name.Operator, u'=='),
+ (Token.Literal.Number.Integer, u'4'),
+ (Token.Text, u'\n'),
+ ]
+ self.assertEqual(tokens, list(self.lexer.get_tokens(fragment)))
+