2019-04-29 20:27:42 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-27 22:27:38 -04:00
|
|
|
RSpec.describe HighlightJs do
|
2015-03-13 01:15:13 -04:00
|
|
|
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(%w[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
|