Sha256: fc7c50b53bb77dfaccee46912313b129a1cd312e6fcb0ed39b6ae8233a661afa
Contents?: true
Size: 1.05 KB
Versions: 6
Compression:
Stored size: 1.05 KB
Contents
#!/usr/bin/env ruby require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/node' describe "Puppet::Node::ActiveRecord" do confine "Missing Rails" => Puppet.features.rails? 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 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 node = Puppet::Node.new("foo") db_instance.expects(:to_puppet).returns node ar = Puppet::Node::ActiveRecord.new node.expects(:fact_merge) request = Puppet::Indirector::Request.new(:node, :find, "what.ever") ar.find(request) end end
Version data entries
6 entries across 6 versions & 1 rubygems