We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3b1f3d commit e0b08d7Copy full SHA for e0b08d7
spec/coderay_spec.rb
@@ -13,4 +13,23 @@
13
expect(CodeRay.coderay_path('file')).to eq("#{base}/lib/coderay/file")
14
end
15
16
+
17
+ describe '.scan' do
18
+ let(:code) { 'puts "Hello, World!"' }
19
+ let(:tokens) do
20
+ [
21
+ ['puts', :ident],
22
+ [' ', :space],
23
+ [:begin_group, :string],
24
+ ['"', :delimiter],
25
+ ['Hello, World!', :content],
26
27
+ [:end_group, :string]
28
+ ].flatten
29
+ end
30
31
+ it 'returns tokens' do
32
+ expect(CodeRay.scan(code, :ruby).tokens).to eq(tokens)
33
34
35
0 commit comments