Added XML::NodeSet#==
This method can be used to compare two NodeSet instances. By using XML::NodeSet#equal_nodes?() the need for exposing the "nodes" instance variable is also removed.
This commit is contained in:
1 parent
7e38e20586
commit
857ac517d5
2 files changed
+39
No files matched your search
@@ -278,6 +278,23 @@ describe Oga::XML::NodeSet do
|
||||
end
|
||||
end
|
||||
|
||||
context '#==' do
|
||||
before do
|
||||
node = Oga::XML::Node.new
|
||||
@set1 = described_class.new([node])
|
||||
@set2 = described_class.new([node])
|
||||
@set3 = described_class.new
|
||||
end
|
||||
|
||||
example 'return true if two node sets are equal' do
|
||||
@set1.should == @set2
|
||||
end
|
||||
|
||||
example 'return false if two node sets are not equal' do
|
||||
@set1.should_not == @set3
|
||||
end
|
||||
end
|
||||
|
||||
context '#concat' do
|
||||
before do
|
||||
n1 = Oga::XML::Element.new(:name => 'a')
|
||||
|
||||
Reference in new issue
Block a user