Skip to content

Commit 2b97e4a

Browse files
committed
clean up per code review
1 parent b406e10 commit 2b97e4a

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

‎lib/roxml.rb‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ def to_xml(params = {})
4242
ref.update_xml(root, value)
4343
end
4444
end
45-
params[:namespaces].each { |prefix, url| root.add_namespace_definition(prefix, url) } if params[:namespaces]
45+
if params[:namespaces]
46+
params[:namespaces].each { |prefix, url| root.add_namespace_definition(prefix, url) }
47+
end
4648
end
4749
end
4850
end

‎spec/xml/namespace_spec.rb‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class VApp
5050
describe "#to_xml" do
5151
it "should reproduce the input xml" do
5252
output = ROXML::XML::Document.new
53-
namespaces = {'vmw' => "http://foo.example.com", 'gronk' => "http://gronk.example.com"}
5453
output.root = VApp.from_xml(@xml).to_xml(:namespaces => {'vmw' => "http://foo.example.com", 'gronk' => "http://gronk.example.com"})
5554
expect(ROXML::XML.parse_string(output.to_s)).to be_equivalent_to(ROXML::XML.parse_string(@xml))
5655
end

0 commit comments

Comments
 (0)