summaryrefslogtreecommitdiffstats
path: root/test/objects/tc_basic.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2005-04-18 22:33:09 +0000
committerLuke Kanies <luke@madstop.com>2005-04-18 22:33:09 +0000
commitde360c97d90e7af5c44f57959ebeaa6f0c8cdbb4 (patch)
treea4df556da7ce62fbbd1af797fb335c97315bcce9 /test/objects/tc_basic.rb
parentb872b726a901a348d4c0c42ba945c04d5990ca1d (diff)
downloadpuppet-de360c97d90e7af5c44f57959ebeaa6f0c8cdbb4.tar.gz
puppet-de360c97d90e7af5c44f57959ebeaa6f0c8cdbb4.tar.xz
puppet-de360c97d90e7af5c44f57959ebeaa6f0c8cdbb4.zip
renaming objects to types, since they are just subclasses of Blink::Type
git-svn-id: https://reductivelabs.com/svn/puppet/library/trunk@186 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/objects/tc_basic.rb')
-rw-r--r--test/objects/tc_basic.rb98
1 files changed, 0 insertions, 98 deletions
diff --git a/test/objects/tc_basic.rb b/test/objects/tc_basic.rb
deleted file mode 100644
index 6d453d188..000000000
--- a/test/objects/tc_basic.rb
+++ /dev/null
@@ -1,98 +0,0 @@
-if __FILE__ == $0
- $:.unshift '..'
- $:.unshift '../../lib'
- $blinkbase = "../.."
-end
-
-require 'blink'
-require 'test/unit'
-
-# $Id$
-
-class TestBasic < Test::Unit::TestCase
- # hmmm
- # this is complicated, because we store references to the created
- # objects in a central store
- def setup
- @component = nil
- @configfile = nil
- @sleeper = nil
-
- Blink[:debug] = 1
-
- assert_nothing_raised() {
- unless Blink::Component.has_key?("sleeper")
- Blink::Component.new(
- :name => "sleeper"
- )
- end
- @component = Blink::Component["sleeper"]
- }
-
- assert_nothing_raised() {
- cfile = File.join($blinkbase,"examples/root/etc/configfile")
- unless Blink::Type::File.has_key?(cfile)
- Blink::Type::File.new(
- :path => cfile
- )
- end
- @configfile = Blink::Type::File[cfile]
- }
- assert_nothing_raised() {
- unless Blink::Type::Service.has_key?("sleeper")
- Blink::Type::Service.new(
- :name => "sleeper",
- :running => 1
- )
- Blink::Type::Service.addpath(
- File.join($blinkbase,"examples/root/etc/init.d")
- )
- end
- @sleeper = Blink::Type::Service["sleeper"]
- }
- assert_nothing_raised() {
- @component.push(
- @configfile,
- @sleeper
- )
- }
-
- #puts "Component is %s, id %s" % [@component, @component.object_id]
- #puts "ConfigFile is %s, id %s" % [@configfile, @configfile.object_id]
- end
-
- def test_name_calls
- [@component,@sleeper,@configfile].each { |obj|
- assert_nothing_raised(){
- obj.name
- }
- }
- end
-
- def test_name_equality
- #puts "Component is %s, id %s" % [@component, @component.object_id]
- assert_equal(
- "sleeper",
- @component.name
- )
-
- assert_equal(
- File.join($blinkbase,"examples/root/etc/configfile"),
- @configfile.name
- )
-
- assert_equal(
- "sleeper",
- @sleeper.name
- )
- end
-
- def test_object_retrieval
- [@component,@sleeper,@configfile].each { |obj|
- assert_equal(
- obj.class[obj.name].object_id,
- obj.object_id
- )
- }
- end
-end