diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2009-12-18 18:48:05 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-12-20 08:54:33 +1100 |
commit | 727ee72b12125223b5d0d0704dc35f5c71a1a04e (patch) | |
tree | b7b0ec1fcb5546dedadf95791ac9ccf0176c6292 /spec | |
parent | 8c8e9210a2b538a1848d309ef9f3966d94a95de9 (diff) | |
download | puppet-727ee72b12125223b5d0d0704dc35f5c71a1a04e.tar.gz puppet-727ee72b12125223b5d0d0704dc35f5c71a1a04e.tar.xz puppet-727ee72b12125223b5d0d0704dc35f5c71a1a04e.zip |
Fix #2966 spec/unit/util/queue.rb can't be run twice
This spec wasn't cleaing up after itself, and raised several exceptions
when trying to register the same queue type again.
Part of the #2879 test idempotency suite.
Signed-off-by: Jesse Wolfe <jes5199@gmail.com>
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/util/queue.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/unit/util/queue.rb b/spec/unit/util/queue.rb index 19af9430e..c8a75550e 100755 --- a/spec/unit/util/queue.rb +++ b/spec/unit/util/queue.rb @@ -19,16 +19,24 @@ end mod = Puppet::Util::Queue client_classes = { :default => make_test_client_class('Bogus::Default'), :setup => make_test_client_class('Bogus::Setup') } -mod.register_queue_type(client_classes[:default], :default) -mod.register_queue_type(client_classes[:setup], :setup) describe Puppet::Util::Queue do + before :all do + mod.register_queue_type(client_classes[:default], :default) + mod.register_queue_type(client_classes[:setup], :setup) + end + before :each do @class = Class.new do extend mod end end + after :all do + instances = mod.instance_hash(:queue_clients) + [:default, :setup, :bogus, :aardvark, :conflict, :test_a, :test_b].each{ |x| instances.delete(x) } + end + context 'when determining a type name from a class' do it 'should handle a simple one-word class name' do mod.queue_type_from_class(make_test_client_class('Foo')).should == :foo |