summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-05-16 09:52:04 -0700
committerJacob Helwig <jacob@puppetlabs.com>2011-05-16 10:06:57 -0700
commitc8775f9c5caa883ab3b08695b355d3575263b165 (patch)
treeacaa12b963a380b80a1004b81f01f77749cc8d32
parent1ad8158da2435126693e02c66d188dd79e71f83d (diff)
downloadpuppet-c8775f9c5caa883ab3b08695b355d3575263b165.tar.gz
puppet-c8775f9c5caa883ab3b08695b355d3575263b165.tar.xz
puppet-c8775f9c5caa883ab3b08695b355d3575263b165.zip
(#7259) Remove ActiveRecord requirement from indirector face spec
"should be able to return a list of terminuses for a given indirection" was calling Puppet::Indirector::Face.terminus_classes, which is just a thin wrapper around Puppet::Indirector::Terminus.terminus_classes, which would attempt to load all Terminus classes. This would cause problems if not all of the prerequisites for all of the Terminus classes were installed (For example: ActiveRecord). Now we only test that the thin wrapper appropriately munges the output from Puppet::Indirector::Terminus.terminus_classes, since the method being wrapped should have its own tests for the behavior that was being tested originally. Paired-with: Nick Lewis <nick@puppetlabs.com>
-rwxr-xr-xspec/unit/indirector/face_spec.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/spec/unit/indirector/face_spec.rb b/spec/unit/indirector/face_spec.rb
index 1530f7270..943ff7991 100755
--- a/spec/unit/indirector/face_spec.rb
+++ b/spec/unit/indirector/face_spec.rb
@@ -16,8 +16,17 @@ describe Puppet::Indirector::Face do
Puppet::Indirector::Face.indirections.should be_include("catalog")
end
- it "should be able to return a list of terminuses for a given indirection" do
- Puppet::Indirector::Face.terminus_classes(:catalog).should be_include("compiler")
+ it "should return the sorted to_s list of terminus classes" do
+ Puppet::Indirector::Terminus.expects(:terminus_classes).returns([
+ :yaml,
+ :compiler,
+ :rest
+ ])
+ Puppet::Indirector::Face.terminus_classes(:catalog).should == [
+ 'compiler',
+ 'rest',
+ 'yaml'
+ ]
end
describe "as an instance" do