Sha256: ec14bcd465c9487c15ed746f01c5608af80545a0b86c2adb7b3187fcaf008450

Contents?: true

Size: 529 Bytes

Versions: 1

Compression:

Stored size: 529 Bytes

Contents

# encoding: UTF-8

require File.expand_path("../lib/pygments", File.dirname(__FILE__))
require "nokogiri"

test "colorizes output" do
  output = Pygments.pygmentize(%Q[{foo: "bar"}], :javascript)

  doc = Nokogiri::HTML(output)

  assert doc.at_xpath(".//div[@class='highlight']")
  assert doc.at_xpath(".//div[@class='highlight']/pre/span[@class='nx' and text()='foo']")
end

test "handles encodings" do
  output = Pygments.pygmentize(%Q[{foo: "bar", baz: "qüx"}], :javascript)

  assert output.encoding == Encoding::UTF_8
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pygmentize-0.0.1 test/pygments.rb