Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 10967cd2 authored by Jonathan Riddell's avatar Jonathan Riddell 🏄

testing

parent 71906451
Gemfile.lock Gemfile.lock
test/data/*.testout
...@@ -39,13 +39,12 @@ class MetaInfoUpdater ...@@ -39,13 +39,12 @@ class MetaInfoUpdater
@doc = File.open(@filename) { |f| Nokogiri::XML(f, &:noblanks) } @doc = File.open(@filename) { |f| Nokogiri::XML(f, &:noblanks) }
component = @doc.at_css("component") component = @doc.at_css("component")
releases = component.add_child("<releases><release version='1.0' date='today'/></releases>") releases = component.add_child("<releases><release version='1.0' date='today'/></releases>")
puts component.to_xml(:indent => 2)
end end
def save_file def save_file
#File.write("#{@filename}.new", @doc.to_xml(:indent => 2)) #File.write("#{@filename}.new", @doc.to_xml(:indent => 2))
save_file_name = @filename save_file_name = @filename
save_file_name = "#{@filename}.new" if @testing save_file_name = "#{@filename}.testout" if @testing
f = File.open(save_file_name, "w") f = File.open(save_file_name, "w")
@doc.write_xml_to(f, {indent: 2}) @doc.write_xml_to(f, {indent: 2})
end end
......
...@@ -9,6 +9,6 @@ class MetaInfoUpdaterTest < MiniTest::Unit::TestCase ...@@ -9,6 +9,6 @@ class MetaInfoUpdaterTest < MiniTest::Unit::TestCase
# open the __FILE__ # open the __FILE__
# do the thing # do the thing
# compare the file # compare the file
assert_equal(true, true) assert_equal(File.read("data/no-releases.appdata.xml.testout"), File.read("data/no-releases.appdata.xml.good"))
end end
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment