test/lib/poolparty/base_test.rb in auser-poolparty-1.3.4 vs test/lib/poolparty/base_test.rb in auser-poolparty-1.3.5
- old
+ new
@@ -1,7 +1,9 @@
require "#{File.dirname(__FILE__)}/../../test_helper"
+include_fixture_resources
+
class BaseTestClass < PoolParty::Base
default_options :a => "a", :d => "dump"
end
class BaseTest < Test::Unit::TestCase
@@ -27,8 +29,19 @@
assert_equal %w(c), @b.all_resources.map {|r| r.name }
end
def test_resource_graph
assert_equal GRATR::Digraph, inst.resources_graph.class
+ end
+
+ def test_instantiation
+ PoolParty::Resource.define_resource_methods
+ assert_equal "string_name", FakeResource.new.has_tester("string_name").name
+ assert_equal "opts_name", FakeResource.new.has_tester(:name => "opts_name").name
+ i = FakeResource.new
+ i.has_tester do
+ self.name "block_name"
+ end
+ assert_equal "block_name", i.testers.first.name
end
end
\ No newline at end of file