summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-05-16 09:52:04 -0700
committerPieter van de Bruggen <pieter@puppetlabs.com>2011-05-18 15:44:51 -0700
commit83c756367ef4bfc404b2395362f796c2c942b053 (patch)
treec0525cb08e6c271b18b1275ecdea8bac5af5ca5d /spec/unit
parentaad2fd780b5134af4f5385c38c15a72c28697bd0 (diff)
downloadpuppet-83c756367ef4bfc404b2395362f796c2c942b053.tar.gz
puppet-83c756367ef4bfc404b2395362f796c2c942b053.tar.xz
puppet-83c756367ef4bfc404b2395362f796c2c942b053.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>
Diffstat (limited to 'spec/unit')
-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