Clean up changes from PR #174

This commit is contained in:
Yorick Peterse 2017-04-18 12:55:11 +02:00
parent 4250033ed5
commit 84c4db3e9f
No known key found for this signature in database
GPG Key ID: EDD30D2BEB691AC9
2 changed files with 17 additions and 13 deletions

View File

@ -3,12 +3,13 @@
This document contains details of the various releases and their release dates.
Dates are in the format `yyyy-mm-dd`.
## Unreleased
## 2.10 - 2017-04-18
### Fix `Element#attribute` result for HTML doc when `Symbol` passed as name
### Fix `Element#attribute` for HTML documents when using Symbol arguments
Using `Symbol` is working for XML doc, but was not working for HTML doc.
See [PR #174](https://github.com/YorickPeterse/oga/pull/174)
You can now pass a Symbol to `Oga::XML::Element#attribute` for both XML and HTML
documents, previously this only worked for XML documents. See [PR
#174](https://github.com/YorickPeterse/oga/pull/174) for more information.
## 2.9 - 2017-02-10

View File

@ -107,22 +107,25 @@ describe Oga::XML::Element do
end
describe 'using an HTML document' do
let!(:attr) do
Oga::XML::Attribute.new(:name => 'foo:bar', :value => 'foo')
let(:attr) do
Oga::XML::Attribute.new(name: 'foo:bar', value: 'foo')
end
let!(:el) do
described_class.new(:name => 'foo', :attributes => [attr])
end
let!(:doc) do
Oga::XML::Document.new(:children => [el], :type => :html)
let(:el) do
el = described_class.new(name: 'foo', attributes: [attr])
Oga::XML::Document.new(children: [el], type: :html)
el
end
it 'returns an attribute with a name containing a namespace separator' do
el.attribute('foo:bar').should == attr
end
it 'returns an attribute with a name containing a namespace separator when using a Symbol' do
el.attribute(:'foo:bar').should == attr
describe 'using a Symbol argument' do
it 'returns the attribute' do
el.attribute(:'foo:bar').should == attr
end
end
end
end