summaryrefslogtreecommitdiffstats
path: root/spec/unit/indirector/node/active_record_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/indirector/node/active_record_spec.rb')
-rwxr-xr-xspec/unit/indirector/node/active_record_spec.rb48
1 files changed, 24 insertions, 24 deletions
diff --git a/spec/unit/indirector/node/active_record_spec.rb b/spec/unit/indirector/node/active_record_spec.rb
index 8e7d1d6bd..6cc3f5132 100755
--- a/spec/unit/indirector/node/active_record_spec.rb
+++ b/spec/unit/indirector/node/active_record_spec.rb
@@ -6,36 +6,36 @@ require 'puppet/node'
require 'spec/lib/puppet_spec/files.rb'
describe "Puppet::Node::ActiveRecord" do
- include PuppetSpec::Files
+ include PuppetSpec::Files
- confine "Missing Rails" => Puppet.features.rails?
- confine "Missing sqlite" => Puppet.features.sqlite?
- before do
- require 'puppet/indirector/node/active_record'
- end
+ confine "Missing Rails" => Puppet.features.rails?
+ confine "Missing sqlite" => Puppet.features.sqlite?
+ before do
+ require 'puppet/indirector/node/active_record'
+ end
- it "should be a subclass of the ActiveRecord terminus class" do
- Puppet::Node::ActiveRecord.ancestors.should be_include(Puppet::Indirector::ActiveRecord)
- end
+ it "should be a subclass of the ActiveRecord terminus class" do
+ Puppet::Node::ActiveRecord.ancestors.should be_include(Puppet::Indirector::ActiveRecord)
+ end
- it "should use Puppet::Rails::Host as its ActiveRecord model" do
- Puppet::Node::ActiveRecord.ar_model.should equal(Puppet::Rails::Host)
- end
+ it "should use Puppet::Rails::Host as its ActiveRecord model" do
+ Puppet::Node::ActiveRecord.ar_model.should equal(Puppet::Rails::Host)
+ end
- it "should call fact_merge when a node is found" do
- db_instance = stub 'db_instance'
- Puppet::Node::ActiveRecord.ar_model.expects(:find_by_name).returns db_instance
+ it "should call fact_merge when a node is found" do
+ db_instance = stub 'db_instance'
+ Puppet::Node::ActiveRecord.ar_model.expects(:find_by_name).returns db_instance
- node = Puppet::Node.new("foo")
- db_instance.expects(:to_puppet).returns node
+ node = Puppet::Node.new("foo")
+ db_instance.expects(:to_puppet).returns node
- Puppet[:statedir] = tmpdir('active_record_tmp')
- Puppet[:railslog] = '$statedir/rails.log'
- ar = Puppet::Node::ActiveRecord.new
+ Puppet[:statedir] = tmpdir('active_record_tmp')
+ Puppet[:railslog] = '$statedir/rails.log'
+ ar = Puppet::Node::ActiveRecord.new
- node.expects(:fact_merge)
+ node.expects(:fact_merge)
- request = Puppet::Indirector::Request.new(:node, :find, "what.ever")
- ar.find(request)
- end
+ request = Puppet::Indirector::Request.new(:node, :find, "what.ever")
+ ar.find(request)
+ end
end