2019-04-30 08:27:42 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-28 10:27:38 +08:00
|
|
|
RSpec.describe HighlightJs do
|
2015-03-13 13:15:13 +08:00
|
|
|
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(%w[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
|