From 41e40e2bb67273cd8e57b98d5d5be85ccc45681b Mon Sep 17 00:00:00 2001 From: Mauro George Date: Thu, 12 Feb 2015 19:24:47 -0200 Subject: [PATCH] Add code coverage to AwesomePrint::Nokogiri when handles a empty NodeSet --- spec/ext/nokogiri_spec.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spec/ext/nokogiri_spec.rb b/spec/ext/nokogiri_spec.rb index 19623e0..466059b 100644 --- a/spec/ext/nokogiri_spec.rb +++ b/spec/ext/nokogiri_spec.rb @@ -42,4 +42,9 @@ RSpec.describe "AwesomePrint/Nokogiri" do \e[0m<\e[1;36m/html\e[0m> EOS end + + it "handle empty NodeSet" do + xml = Nokogiri::XML::NodeSet.new(Nokogiri::XML('')) + expect(xml.ai).to eq('[]') + end end