Enforce symbols for element attributes.

This comes with a little bit of memory overhead but this should be minor in
most cases.
This commit is contained in:
Yorick Peterse committed 2014-05-15 01:04:26 +02:00
1 parent f4b9bbd4ac
commit 723a273e4f
5 files changed
+7 -7

No files matched your search

+2 -2
View File
@@ -20,7 +20,7 @@ describe Oga::XML::Element do
context '#attribute' do
before do
@instance = described_class.new(:attributes => {'key' => 'value'})
@instance = described_class.new(:attributes => {:key => 'value'})
end
example 'return an attribute' do
@@ -42,7 +42,7 @@ describe Oga::XML::Element do
example 'include the attributes if present' do
instance = described_class.new(
:name => 'p',
:attributes => {'key' => 'value'}
:attributes => {:key => 'value'}
)
instance.to_xml.should == '<p key="value"></p>'
+1 -1
View File
@@ -43,7 +43,7 @@ describe Oga::XML::Parser do
end
example 'set the attributes of the element' do
@element.attributes.should == {'bar' => 'baz'}
@element.attributes.should == {:bar => 'baz'}
end
end
@@ -39,7 +39,7 @@ describe Oga::XML::Parser do
end
example 'set the attributes' do
@node.attributes.should == {'href' => 'foo'}
@node.attributes.should == {:href => 'foo'}
end
end
end