Skip to content

Commit

Permalink
add a test for issue #784
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshahid committed Dec 2, 2012
1 parent 3fd7d3b commit 8832ca9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/xml/test_builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# -*- coding: utf-8 -*-

require "helper"

module Nokogiri
Expand All @@ -11,6 +13,12 @@ def test_attribute_sensitivity
assert_equal 'world', doc.root['abcDef']
end

def test_builder_with_utf8_text
text = "test ﺵ "
doc = Nokogiri::XML::Builder.new(encoding: "UTF-8") { |xml| xml.test text }.doc
assert_equal text, doc.content
end

def test_builder_escape
xml = Nokogiri::XML::Builder.new { |x|
x.condition "value < 1", :attr => "value < 1"
Expand Down

0 comments on commit 8832ca9

Please sign in to comment.