2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-03-13 13:15:13 +08:00
|
|
|
describe HighlightJs do
|
|
|
|
it 'can list languages' do
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(HighlightJs.languages).to include('thrift')
|
2015-03-13 13:15:13 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'can generate a packed bundle' do
|
|
|
|
bundle = HighlightJs.bundle(["thrift", "http"])
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(bundle).to match(/thrift/)
|
|
|
|
expect(bundle).to match(/http/)
|
|
|
|
expect(bundle).not_to match(/applescript/)
|
2015-03-13 13:15:13 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'can get a version string' do
|
|
|
|
version1 = HighlightJs.version("http|cpp")
|
|
|
|
version2 = HighlightJs.version("rust|cpp|fake")
|
|
|
|
|
2015-04-25 23:18:35 +08:00
|
|
|
expect(version1).not_to eq(version2)
|
2015-03-13 13:15:13 +08:00
|
|
|
end
|
|
|
|
end
|