diff options
author | 2019-07-22 12:58:03 +0200 | |
---|---|---|
committer | 2019-07-22 12:58:03 +0200 | |
commit | 79ceea57dbe05c9352707add4652ab37daef7c57 (patch) | |
tree | 03c9d713e71b606be8a80fb9b7b65baadcb3991c /test | |
parent | Remove stubs for category search method (diff) | |
download | packages-5-79ceea57dbe05c9352707add4652ab37daef7c57.tar.gz packages-5-79ceea57dbe05c9352707add4652ab37daef7c57.tar.bz2 packages-5-79ceea57dbe05c9352707add4652ab37daef7c57.zip |
Add a package test fixture and fix USE flag tests
Signed-off-by: Hans de Graaff <graaff@gentoo.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/controllers/useflags_controller_test.rb | 4 | ||||
-rw-r--r-- | test/fixtures/repo/metadata/layout.conf | 1 | ||||
-rw-r--r-- | test/fixtures/repo/metadata/md5-cache/virtual/packages-1 | 7 | ||||
-rw-r--r-- | test/fixtures/repo/virtual/packages/Manifest | 2 | ||||
-rw-r--r-- | test/fixtures/repo/virtual/packages/metadata.xml | 8 | ||||
-rw-r--r-- | test/fixtures/repo/virtual/packages/packages-1.ebuild | 17 | ||||
-rw-r--r-- | test/test_helper.rb | 2 |
7 files changed, 38 insertions, 3 deletions
diff --git a/test/controllers/useflags_controller_test.rb b/test/controllers/useflags_controller_test.rb index aa9e42d..7adfca9 100644 --- a/test/controllers/useflags_controller_test.rb +++ b/test/controllers/useflags_controller_test.rb @@ -7,12 +7,12 @@ class UseflagsControllerTest < ActionController::TestCase end test "should get show" do - get :show + get :show, id: 'test' assert_response :success end test "should get search" do - get :search + get :search, q: 'test' assert_response :success end diff --git a/test/fixtures/repo/metadata/layout.conf b/test/fixtures/repo/metadata/layout.conf new file mode 100644 index 0000000..903fe53 --- /dev/null +++ b/test/fixtures/repo/metadata/layout.conf @@ -0,0 +1 @@ +masters=gentoo diff --git a/test/fixtures/repo/metadata/md5-cache/virtual/packages-1 b/test/fixtures/repo/metadata/md5-cache/virtual/packages-1 new file mode 100644 index 0000000..e1538a9 --- /dev/null +++ b/test/fixtures/repo/metadata/md5-cache/virtual/packages-1 @@ -0,0 +1,7 @@ +DEFINED_PHASES=compile install postinst preinst prepare setup unpack +DESCRIPTION=Test ebuild for packages +EAPI=7 +IUSE=test +KEYWORDS=~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris +SLOT=0 +_md5_=22353e920b69c50dcacb4916ce221ae5 diff --git a/test/fixtures/repo/virtual/packages/Manifest b/test/fixtures/repo/virtual/packages/Manifest new file mode 100644 index 0000000..2a9502e --- /dev/null +++ b/test/fixtures/repo/virtual/packages/Manifest @@ -0,0 +1,2 @@ +EBUILD packages-1.ebuild 575 BLAKE2B a676669e2fe81b85fcc6181863028d0e3dc955eed2571503c05b99e47e899ec8be1c0ffb173025656e2461c4a7aa9c2da0eea97b49523d831dd2eaa1a496b30d SHA512 0495b174e428424f46b6876ebcbea4fae0b689b00b92a31b5ef7ef010df1aae31870e51a801a5e95388380665758ff241113c0e1b959bd192a290e5cfb801ef8 +MISC metadata.xml 286 BLAKE2B 070b5e95fe4cc9d7dc5f4b1866a46889c7d4f82954ff312237b7e82ed8ae0fc5bd99391112c7331f0230d5e2c47512dc0abc9b3b3f3c7b69738f90cc2eb4c542 SHA512 a4b0f634366d1cfb24b2edcc844dcde0293cf98b1506672e7e77055eeedf3ef275989b1850a42d7bfb79b704e3f1907d198a0efe9dcc7fe4920cd5b32c614c14 diff --git a/test/fixtures/repo/virtual/packages/metadata.xml b/test/fixtures/repo/virtual/packages/metadata.xml new file mode 100644 index 0000000..d21750d --- /dev/null +++ b/test/fixtures/repo/virtual/packages/metadata.xml @@ -0,0 +1,8 @@ +<?xml version = '1.0' encoding = 'UTF-8'?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"><email>infra@gentoo.org</email></maintainer> + <use> + <flag name="test">Test flag for packages</flag> + </use> +</pkgmetadata> diff --git a/test/fixtures/repo/virtual/packages/packages-1.ebuild b/test/fixtures/repo/virtual/packages/packages-1.ebuild new file mode 100644 index 0000000..f51c750 --- /dev/null +++ b/test/fixtures/repo/virtual/packages/packages-1.ebuild @@ -0,0 +1,17 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DESCRIPTION="Test ebuild for packages" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="test" + +pkg_setup() { :; } +src_unpack() { :; } +src_prepare() { eapply_user; } +src_compile() { :; } +src_install() { :; } +pkg_preinst() { :; } +pkg_postinst() { :; } diff --git a/test/test_helper.rb b/test/test_helper.rb index 98b65a4..c71aa37 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -6,6 +6,6 @@ class ActiveSupport::TestCase # Import some test data into the test indices category = Portage::Repository::Category.new('test/fixtures/repo/virtual') Category.new.import!(category) - + UseflagsUpdateJob.new.perform # Add more helper methods to be used by all tests here... end |