~bkerensa/ubuntu/raring/puppet/new-upstream-release

« back to all changes in this revision

Viewing changes to spec/integration/defaults_spec.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 01:00:37 UTC
  • mfrom: (1.1.24 upstream) (3.1.25 sid)
  • Revision ID: james.westby@ubuntu.com-20110725010037-875vuxs10eboqgw3
Tags: 2.7.1-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/puppetmaster-passenger.postinst: Use cacrl instead of hostcrl to
    set the location of the CRL in apache2 configuration. Fix apache2
    configuration on upgrade as well (LP: #641001)
  - move all puppet dependencies to puppet-common since all the code
    actually located in puppet-common.
  - move libagueas from a recommend to a dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env ruby
2
 
 
3
 
require File.dirname(__FILE__) + '/../spec_helper'
 
1
#!/usr/bin/env rspec
 
2
require 'spec_helper'
4
3
 
5
4
require 'puppet/defaults'
6
5
require 'puppet/rails'
116
115
 
117
116
  describe "when enabling storeconfigs" do
118
117
    before do
119
 
      Puppet::Resource::Catalog.stubs(:cache_class=)
120
 
      Puppet::Node::Facts.stubs(:cache_class=)
121
 
      Puppet::Node.stubs(:cache_class=)
 
118
      Puppet::Resource::Catalog.indirection.stubs(:cache_class=)
 
119
      Puppet::Node::Facts.indirection.stubs(:cache_class=)
 
120
      Puppet::Node.indirection.stubs(:cache_class=)
122
121
 
123
122
      Puppet.features.stubs(:rails?).returns true
124
123
    end
125
124
 
126
125
    it "should set the Catalog cache class to :active_record" do
127
 
      Puppet::Resource::Catalog.expects(:cache_class=).with(:active_record)
 
126
      Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:active_record)
128
127
      Puppet.settings[:storeconfigs] = true
129
128
    end
130
129
 
131
130
    it "should not set the Catalog cache class to :active_record if asynchronous storeconfigs is enabled" do
132
 
      Puppet::Resource::Catalog.expects(:cache_class=).with(:active_record).never
 
131
      Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:active_record).never
133
132
      Puppet.settings.expects(:value).with(:async_storeconfigs).returns true
134
133
      Puppet.settings[:storeconfigs] = true
135
134
    end
136
135
 
137
136
    it "should set the Facts cache class to :active_record" do
138
 
      Puppet::Node::Facts.expects(:cache_class=).with(:active_record)
 
137
      Puppet::Node::Facts.indirection.expects(:cache_class=).with(:active_record)
139
138
      Puppet.settings[:storeconfigs] = true
140
139
    end
141
140
 
142
141
    it "should set the Node cache class to :active_record" do
143
 
      Puppet::Node.expects(:cache_class=).with(:active_record)
 
142
      Puppet::Node.indirection.expects(:cache_class=).with(:active_record)
144
143
      Puppet.settings[:storeconfigs] = true
145
144
    end
146
145
 
152
151
 
153
152
  describe "when enabling asynchronous storeconfigs" do
154
153
    before do
155
 
      Puppet::Resource::Catalog.stubs(:cache_class=)
156
 
      Puppet::Node::Facts.stubs(:cache_class=)
157
 
      Puppet::Node.stubs(:cache_class=)
 
154
      Puppet::Resource::Catalog.indirection.stubs(:cache_class=)
 
155
      Puppet::Node::Facts.indirection.stubs(:cache_class=)
 
156
      Puppet::Node.indirection.stubs(:cache_class=)
158
157
      Puppet.features.stubs(:rails?).returns true
159
158
    end
160
159
 
164
163
    end
165
164
 
166
165
    it "should set the Catalog cache class to :queue" do
167
 
      Puppet::Resource::Catalog.expects(:cache_class=).with(:queue)
 
166
      Puppet::Resource::Catalog.indirection.expects(:cache_class=).with(:queue)
168
167
      Puppet.settings[:async_storeconfigs] = true
169
168
    end
170
169
 
171
170
    it "should set the Facts cache class to :active_record" do
172
 
      Puppet::Node::Facts.expects(:cache_class=).with(:active_record)
 
171
      Puppet::Node::Facts.indirection.expects(:cache_class=).with(:active_record)
173
172
      Puppet.settings[:storeconfigs] = true
174
173
    end
175
174
 
176
175
    it "should set the Node cache class to :active_record" do
177
 
      Puppet::Node.expects(:cache_class=).with(:active_record)
 
176
      Puppet::Node.indirection.expects(:cache_class=).with(:active_record)
178
177
      Puppet.settings[:storeconfigs] = true
179
178
    end
180
179
  end
181
180
 
182
181
  describe "when enabling thin storeconfigs" do
183
182
    before do
184
 
      Puppet::Resource::Catalog.stubs(:cache_class=)
185
 
      Puppet::Node::Facts.stubs(:cache_class=)
186
 
      Puppet::Node.stubs(:cache_class=)
 
183
      Puppet::Resource::Catalog.indirection.stubs(:cache_class=)
 
184
      Puppet::Node::Facts.indirection.stubs(:cache_class=)
 
185
      Puppet::Node.indirection.stubs(:cache_class=)
187
186
      Puppet.features.stubs(:rails?).returns true
188
187
    end
189
188