Distinguish default attribute/element namespaces

The previous commit messed this up because I wasn't fully awake.
This commit is contained in:
Yorick Peterse committed 2015-03-26 00:43:50 +01:00
1 parent 68ada997a8
commit f2d69af33b
3 files changed
+13 -2

No files matched your search

+11
View File
@@ -21,6 +21,17 @@ module Oga
class Attribute
attr_accessor :name, :namespace_name, :element, :value
##
# The default namespace available to all attributes. This namespace can
# not be modified.
#
# @return [Oga::XML::Namespace]
#
DEFAULT_NAMESPACE = Namespace.new(
:name => 'xml',
:uri => XML::DEFAULT_NAMESPACE.uri
).freeze
##
# @param [Hash] options
#
+1 -1
View File
@@ -6,7 +6,7 @@ module Oga
# @return [Oga::XML::Namespace]
#
DEFAULT_NAMESPACE = Namespace.new(
:name => 'xml',
:name => 'xmlns',
:uri => 'http://www.w3.org/XML/1998/namespace'
).freeze
end # XML
+1 -1
View File
@@ -33,7 +33,7 @@ describe Oga::XML::Attribute do
end
it 'returns the default XML namespace when the "xml" prefix is used' do
@default.namespace.should == Oga::XML::DEFAULT_NAMESPACE
@default.namespace.should == Oga::XML::Attribute::DEFAULT_NAMESPACE
end
end