mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 21:48:04 +08:00
22 lines
554 B
Ruby
22 lines
554 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec.describe HighlightJs do
|
|
it "can list languages" do
|
|
expect(HighlightJs.languages).to include("thrift")
|
|
end
|
|
|
|
it "can generate a packed bundle" do
|
|
bundle = HighlightJs.bundle(%w[thrift http])
|
|
expect(bundle).to match(/thrift/)
|
|
expect(bundle).to match(/http/)
|
|
expect(bundle).not_to match(/applescript/)
|
|
end
|
|
|
|
it "can get a version string" do
|
|
version1 = HighlightJs.version("http|cpp")
|
|
version2 = HighlightJs.version("rust|cpp|fake")
|
|
|
|
expect(version1).not_to eq(version2)
|
|
end
|
|
end
|