Skip to content

Commit

Permalink
Add specs for %x with custom delimiter and interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
hediyi committed Jul 1, 2016
1 parent 42b153b commit 28743ea
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/ruby-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ 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 %x!! style strings", ->
{tokens} = grammar.tokenizeLine('%x!\#\{"l" + "s"\}!')

expect(tokens[0]).toEqual value: '%x!', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'punctuation.definition.string.begin.ruby']
expect(tokens[1]).toEqual value: '#{', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'meta.embedded.line.ruby', 'punctuation.section.embedded.begin.ruby']
expect(tokens[11]).toEqual value: '}', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'meta.embedded.line.ruby', 'punctuation.section.embedded.end.ruby']
expect(tokens[12]).toEqual value: '!', scopes: ['source.ruby', 'string.quoted.other.interpolated.ruby', 'punctuation.definition.string.end.ruby']

it "tokenizes regular expressions", ->
{tokens} = grammar.tokenizeLine('/test/')

Expand Down

0 comments on commit 28743ea

Please sign in to comment.