spec/unit/indirector.rb in puppet-0.24.9 vs spec/unit/indirector.rb in puppet-0.25.0
- old
+ new
@@ -34,11 +34,11 @@
it "should create an indirection instance to manage each indirecting model" do
@indirection = @thingie.indirects(:test)
@indirection.should be_instance_of(Puppet::Indirector::Indirection)
end
-
+
it "should not allow a model to register under multiple names" do
# Keep track of the indirection instance so we can delete it on cleanup
@indirection = @thingie.indirects :first
Proc.new { @thingie.indirects :second }.should raise_error(ArgumentError)
end
@@ -50,9 +50,14 @@
it "should pass any provided options to the indirection during initialization" do
klass = mock 'terminus class'
Puppet::Indirector::Indirection.expects(:new).with(@thingie, :first, {:some => :options})
@indirection = @thingie.indirects :first, :some => :options
+ end
+
+ it "should extend the class with the Format Handler" do
+ @indirection = @thingie.indirects :first
+ @thingie.metaclass.ancestors.should be_include(Puppet::Network::FormatHandler)
end
after do
@indirection.delete if @indirection
end