From e434194223a2ace6b007973de05a61155a60104e Mon Sep 17 00:00:00 2001 From: esdoppio Date: Wed, 29 Jun 2016 11:32:07 +0800 Subject: [PATCH] :white_check_mark: Add specs for ! --- spec/ruby-spec.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/ruby-spec.coffee b/spec/ruby-spec.coffee index a2a6b85..31bd598 100644 --- a/spec/ruby-spec.coffee +++ b/spec/ruby-spec.coffee @@ -476,6 +476,14 @@ describe "Ruby grammar", -> {tokens} = grammar.tokenizeLine('not true') expect(tokens[0]).toEqual value: 'not', scopes: ['source.ruby', 'keyword.operator.logical.ruby'] + it "tokenizes ! when used in method name", -> + {tokens} = grammar.tokenizeLine('sort!') + expect(tokens[0]).toEqual value: 'sort!', scopes: ['source.ruby'] + + it "tokenizes ! as logical operator", -> + {tokens} = grammar.tokenizeLine('!foo') + expect(tokens[0]).toEqual value: '!', scopes: ['source.ruby', 'keyword.operator.logical.ruby'] + it "tokenizes yard documentation comments", -> {tokens} = grammar.tokenizeLine('# @private') expect(tokens[0]).toEqual value: '#', scopes: ['source.ruby', 'comment.line.number-sign.ruby', 'punctuation.definition.comment.ruby']