Sha256: e0a65270f3d1572ec42152471573570df2bf5a9d9dce4868b70f2416be2bdb10

Contents?: true

Size: 888 Bytes

Versions: 3

Compression:

Stored size: 888 Bytes

Contents

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../spec_helper'

resources = Puppet::Type.type(:resources)

# There are still plenty of tests to port over from test/.
describe resources do
    describe "when initializing" do
        before do
            resources.clear
        end

        it "should fail if the specified resource type does not exist" do
            Puppet::Type.expects(:type).with("nosuchtype").returns nil
            lambda { resources.create :name => "nosuchtype" }.should raise_error(Puppet::Error)
        end

        it "should not fail when the specified resource type exists" do
            lambda { resources.create :name => "file" }.should_not raise_error
        end

        it "should set its :resource_type attribute" do
            resources.create(:name => "file").resource_type.should == Puppet::Type.type(:file)
        end
    end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppet-0.24.9 spec/unit/type/resources.rb
puppet-0.24.7 spec/unit/type/resources.rb
puppet-0.24.8 spec/unit/type/resources.rb