Commit c68f8894 authored by Jonathan Riddell's avatar Jonathan Riddell 🛶

more tests

parent 67ceaa9d
Gemfile.lock
test/data/*.testout
*~
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.kde.cuttlefish.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Cuttlefish</name>
<summary>Icon Previewer for Artists and Developers</summary>
<description>
<p>Cuttlefish allows artists and developers to preview and pick icons. Cuttlefish attempts to render the icons exactly as they would look drawn in the application. It allows to filter based on category and name. Cuttlefish is not a general-purpose tool, but geared towards artists' and developers' use-cases.
Cuttlefish also provides a plugin for Kate and KDevelop to be used as icon picker.
</p>
</description>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=Plasma%20SDK&amp;component=cuttlefish</url>
<screenshots>
<screenshot type="default">
<image>https://www.kde.org/images/screenshots/cuttlefish.png</image>
</screenshot>
</screenshots>
<project_group>KDE</project_group>
<provides>
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="5.0" date="2019-03-24"/>
</releases>
<releases>
<release version="4.0" date="2019-03-23"/>
</releases>
<releases>
<release version="3.0" date="2019-03-22"/>
</releases>
<releases>
<release version="2.0" date="2019-03-21"/>
</releases>
<releases>
<release version="1.0" date="2019-03-20"/>
</releases>
</component>
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.kde.cuttlefish.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Cuttlefish</name>
<summary>Icon Previewer for Artists and Developers</summary>
<description>
<p>Cuttlefish allows artists and developers to preview and pick icons. Cuttlefish attempts to render the icons exactly as they would look drawn in the application. It allows to filter based on category and name. Cuttlefish is not a general-purpose tool, but geared towards artists' and developers' use-cases.
Cuttlefish also provides a plugin for Kate and KDevelop to be used as icon picker.
</p>
</description>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=Plasma%20SDK&amp;component=cuttlefish</url>
<screenshots>
<screenshot type="default">
<image>https://www.kde.org/images/screenshots/cuttlefish.png</image>
</screenshot>
</screenshots>
<project_group>KDE</project_group>
<provides>
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="5.0" date="2019-03-24"/>
</releases>
<releases>
<release version="4.0" date="2019-03-23"/>
</releases>
<releases>
<release version="3.0" date="2019-03-22"/>
</releases>
<releases>
<release version="2.0" date="2019-03-21"/>
</releases>
<releases>
<release version="1.0" date="2019-03-20"/>
</releases>
</component>
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.kde.cuttlefish.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Cuttlefish</name>
<summary>Icon Previewer for Artists and Developers</summary>
<description>
<p>Cuttlefish allows artists and developers to preview and pick icons. Cuttlefish attempts to render the icons exactly as they would look drawn in the application. It allows to filter based on category and name. Cuttlefish is not a general-purpose tool, but geared towards artists' and developers' use-cases.
Cuttlefish also provides a plugin for Kate and KDevelop to be used as icon picker.
</p>
</description>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=Plasma%20SDK&amp;component=cuttlefish</url>
<screenshots>
<screenshot type="default">
<image>https://www.kde.org/images/screenshots/cuttlefish.png</image>
</screenshot>
</screenshots>
<project_group>KDE</project_group>
<provides>
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="1.0" date="2019-03-20"/>
</releases>
</component>
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.kde.cuttlefish.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-2.0+</project_license>
<name>Cuttlefish</name>
<summary>Icon Previewer for Artists and Developers</summary>
<description>
<p>Cuttlefish allows artists and developers to preview and pick icons. Cuttlefish attempts to render the icons exactly as they would look drawn in the application. It allows to filter based on category and name. Cuttlefish is not a general-purpose tool, but geared towards artists' and developers' use-cases.
Cuttlefish also provides a plugin for Kate and KDevelop to be used as icon picker.
</p>
</description>
<url type="bugtracker">https://bugs.kde.org/enter_bug.cgi?format=guided&amp;product=Plasma%20SDK&amp;component=cuttlefish</url>
<screenshots>
<screenshot type="default">
<image>https://www.kde.org/images/screenshots/cuttlefish.png</image>
</screenshot>
</screenshots>
<project_group>KDE</project_group>
<provides>
<binary>cuttlefish</binary>
</provides>
<releases>
<release version="1.0" date="2019-03-20"/>
</releases>
<releases>
<release version="2.0" date="2018-01-01"/>
</releases>
</component>
......@@ -2,11 +2,34 @@ require 'minitest/autorun'
require_relative '../lib/appstream-metainfo-release-update'
class MetaInfoUpdaterTest < MiniTest::Test
def test_new_release
updater = MetaInfoUpdater.new("data/no-releases.appdata.xml", "1.0")
# adding a release to a file with no releases
def test_no_releases
file = "no-releases"
updater = MetaInfoUpdater.new("data/#{file}.appdata.xml", "1.0", "2018-01-01")
updater.testing = true
updater.open_file
updater.save_file
assert_equal(File.read("data/no-releases.appdata.xml.good"), File.read("data/no-releases.appdata.xml.testout"))
assert_equal(File.read("data/#{file}.appdata.xml.expected"), File.read("data/#{file}.appdata.xml.testout"))
end
# adding a release to a file with 1 release
def test_one_release
file = "one-release"
updater = MetaInfoUpdater.new("data/#{file}.appdata.xml", "2.0", "2018-01-01")
updater.testing = true
updater.open_file
updater.save_file
assert_equal(File.read("data/#{file}.appdata.xml.expected"), File.read("data/#{file}.appdata.xml.testout"))
end
# adding a release to a file with 5 releases and limit set to 4
def test_five_releases
skip
file = "five-releases"
updater = MetaInfoUpdater.new("data/#{file}.appdata.xml", "1.0", "2018-01-01", 4)
updater.testing = true
updater.open_file
updater.save_file
assert_equal(File.read("data/#{file}.appdata.xml.expected"), File.read("data/#{file}.appdata.xml.testout"))
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