Skip to content

Commit

Permalink
✅ Add specs for % with custom delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
hediyi committed Jul 1, 2016
1 parent 798739f commit ec89782
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions spec/ruby-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ describe "Ruby grammar", ->
expect(tokens[5]).toEqual value: 't', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby']
expect(tokens[6]).toEqual value: '>', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'punctuation.definition.string.end.ruby']

it "tokenizes %~~ style strings", ->
{tokens} = grammar.tokenizeLine('%~te\\~s\\~t~')

expect(tokens[0]).toEqual value: '%~', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'punctuation.definition.string.begin.ruby']
expect(tokens[1]).toEqual value: 'te', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby']
expect(tokens[2]).toEqual value: '\\~', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'constant.character.escape.ruby']
expect(tokens[3]).toEqual value: 's', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby']
expect(tokens[4]).toEqual value: '\\~', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'constant.character.escape.ruby']
expect(tokens[5]).toEqual value: 't', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby']
expect(tokens[6]).toEqual value: '~', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'punctuation.definition.string.end.ruby']

it "tokenizes %Q() style strings", ->
{tokens} = grammar.tokenizeLine('%Q(te(s)t)')

Expand Down

0 comments on commit ec89782

Please sign in to comment.