summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRein Henrichs <rein@puppetlabs.com>2010-06-23 11:22:06 -0700
committertest branch <puppet-dev@googlegroups.com>2010-02-17 06:50:53 -0800
commitbba45f1defe7525e59e9e5c66882e6416bfad99e (patch)
treeffe1529cec8a816ba0f01d6df0fde685f6754913
parent1c5b67d3156873cf3f97aca4d8ca3c6707fc089f (diff)
downloadpuppet-bba45f1defe7525e59e9e5c66882e6416bfad99e.tar.gz
[#4055] Confine CouchDB-related specs to the couchdb feature
Prevents unmet dependency problems when running tests without the couchrest gem
-rw-r--r--lib/puppet/indirector/couch.rb2
-rw-r--r--spec/unit/indirector/facts/couch.rb6
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/puppet/indirector/couch.rb b/lib/puppet/indirector/couch.rb
index dc3e49529..6818ee834 100644
--- a/lib/puppet/indirector/couch.rb
+++ b/lib/puppet/indirector/couch.rb
@@ -1,3 +1,5 @@
+raise "Couch terminus not supported without couchrest gem" unless Puppet.features.couchdb?
+
require 'couchrest'
class Puppet::Indirector::Couch < Puppet::Indirector::Terminus
diff --git a/spec/unit/indirector/facts/couch.rb b/spec/unit/indirector/facts/couch.rb
index 409cb50a1..088401280 100644
--- a/spec/unit/indirector/facts/couch.rb
+++ b/spec/unit/indirector/facts/couch.rb
@@ -3,9 +3,11 @@
require File.dirname(__FILE__) + '/../../../spec_helper'
require 'puppet/node/facts'
-require 'puppet/indirector/facts/couch'
-describe Puppet::Node::Facts::Couch do
+describe "Puppet::Node::Facts::Couch" do
+ confine "couchrest gem is missing; cannot test couch terminus" => Puppet.features.couchdb?
+ require 'puppet/indirector/facts/couch' if Puppet.features.couchdb?
+
before do
@mock_db = mock('couch db')
mock_document = CouchRest::Document.new(:_id => fake_request.key, :facts => fake_request.values)