aboutsummaryrefslogtreecommitdiff
path: root/ruby/find_unused_packages_task_TEST.rb
diff options
context:
space:
mode:
authorAvatar Richard Brown <rbrown@exherbo.org> 2007-03-07 22:44:15 +0000
committerAvatar Richard Brown <rbrown@exherbo.org> 2007-03-07 22:44:15 +0000
commit18f8ce9abc51d4d1b4be0240b81a5d840709c1e3 (patch)
tree2e028d88db290dd0ce7141ee5b70861cb3c34690 /ruby/find_unused_packages_task_TEST.rb
parent78211c1ec110e4ab049865091dfa1300abd173d5 (diff)
downloadpaludis-18f8ce9abc51d4d1b4be0240b81a5d840709c1e3.tar.gz
paludis-18f8ce9abc51d4d1b4be0240b81a5d840709c1e3.tar.xz
Add FindUnusedPackageTask to ruby.
Diffstat (limited to 'ruby/find_unused_packages_task_TEST.rb')
-rw-r--r--ruby/find_unused_packages_task_TEST.rb52
1 files changed, 52 insertions, 0 deletions
diff --git a/ruby/find_unused_packages_task_TEST.rb b/ruby/find_unused_packages_task_TEST.rb
new file mode 100644
index 000000000..648150f7c
--- /dev/null
+++ b/ruby/find_unused_packages_task_TEST.rb
@@ -0,0 +1,52 @@
+#!/usr/bin/env ruby
+# vim: set sw=4 sts=4 et tw=80 :
+
+#
+# Copyright (c) 2007 Richard Brown <rbrown@gentoo.org>
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License version 2, as published by the Free Software Foundation.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+require 'test/unit'
+require 'Paludis'
+
+module Paludis
+ Log.instance.log_level = LogLevel::Warning
+
+ class TestCase_FindUnusedPackagesTask < Test::Unit::TestCase
+ def env
+ NoConfigEnvironment.new(Dir.getwd().to_s + "/find_unused_packages_task_TEST_dir/testrepo")
+ end
+
+ def task
+ FindUnusedPackagesTask.new(env,env.portage_repository)
+ end
+
+ def test_create
+ assert_nothing_raised do
+ task
+ end
+ end
+
+ def test_execute
+ t = task
+ bar = t.execute(QualifiedPackageName.new('foo/bar'))
+ assert bar.empty?
+ baz = t.execute(QualifiedPackageName.new('foo/baz'))
+ assert_equal 1, baz.length
+ assert_kind_of PackageDatabaseEntry, baz.first
+ end
+ end
+end
+