Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 55ab414

Browse files
committed
chore: add tests for 4037d32
1 parent 4037d32 commit 55ab414

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

spec/tree-sitter-spec.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,26 @@ describe('Tree-sitter Ruby grammar', () => {
108108
'.source.ruby .keyword.control'
109109
)
110110
})
111+
112+
it('tokenizes variable in assignment expressions', async () => {
113+
const editor = await atom.workspace.open('foo.rb')
114+
editor.setText(dedent`
115+
a = 10
116+
`)
117+
118+
expect(editor.scopeDescriptorForBufferPosition([0, 0]).toString()).toBe(
119+
'.source.ruby .variable'
120+
)
121+
})
122+
123+
it('does not tokenizes method call in assignment expressions', async () => {
124+
const editor = await atom.workspace.open('foo.rb')
125+
editor.setText(dedent`
126+
foo() = 10
127+
`)
128+
129+
expect(editor.scopeDescriptorForBufferPosition([0, 0]).toString()).not.toBe(
130+
'.source.ruby .variable'
131+
)
132+
})
111133
})

0 commit comments

Comments
 (0)