2015-10-11 05:41:23 -04:00
|
|
|
require 'rails_helper'
|
2015-03-13 01:15:13 -04:00
|
|
|
require_dependency 'highlight_js/highlight_js'
|
|
|
|
|
|
|
|
describe HighlightJs do
|
|
|
|
it 'can list languages' do
|
2015-04-25 11:18:35 -04:00
|
|
|
expect(HighlightJs.languages).to include('thrift')
|
2015-03-13 01:15:13 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'can generate a packed bundle' do
|
|
|
|
bundle = HighlightJs.bundle(["thrift", "http"])
|
2015-04-25 11:18:35 -04:00
|
|
|
expect(bundle).to match(/thrift/)
|
|
|
|
expect(bundle).to match(/http/)
|
|
|
|
expect(bundle).not_to match(/applescript/)
|
2015-03-13 01:15:13 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'can get a version string' do
|
|
|
|
version1 = HighlightJs.version("http|cpp")
|
|
|
|
version2 = HighlightJs.version("rust|cpp|fake")
|
|
|
|
|
2015-04-25 11:18:35 -04:00
|
|
|
expect(version1).not_to eq(version2)
|
2015-03-13 01:15:13 -04:00
|
|
|
end
|
|
|
|
end
|