Skip to content

Commit

Permalink
[BUG] Failing test case for empty attribute values
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jan 5, 2013
1 parent 7e74c9c commit 15ca975
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/xml/test_node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,13 @@ def test_attribute_accessor_accepts_non_string
assert_equal "Yes", address[:domestic]
end

def test_empty_attribute_reading
node = Nokogiri::XML '<foo empty="" whitespace=" "/>'

assert_equal '', node.root['empty']
assert_equal ' ', node.root['whitespace']
end

def test_delete
address = @xml.xpath('/staff/employee/address').first
assert_equal 'Yes', address['domestic']
Expand Down

0 comments on commit 15ca975

Please sign in to comment.