Sha256: ddd350d1cb3ece5e14766b8b8de6491edaa665ad3eff62c6aaa90752da2804f1

Contents?: true

Size: 1.38 KB

Versions: 3

Compression:

Stored size: 1.38 KB

Contents

#!/usr/bin/env ruby

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

provider_class = Puppet::Type.type(:zone).provider(:solaris)

describe provider_class do
    before do
        @resource = stub("resource", :name => "mypool")
        @resource.stubs(:[]).returns "shouldvalue"
        @provider = provider_class.new(@resource)
    end

    describe "when calling configure" do
        it "should add the create args to the create str" do
            @resource.stubs(:properties).returns([])
            @resource.stubs(:[]).with(:create_args).returns("create_args")
            @provider.expects(:setconfig).with("create -b create_args\nset zonepath=shouldvalue\ncommit\n")
            @provider.configure
        end
    end

    describe "when installing" do
        it "should call zoneadm" do
            @provider.expects(:zoneadm)
            @provider.install
        end
        
        it "should just install if there are no install args" do
            @resource.stubs(:[]).with(:install_args).returns(nil)
            @provider.expects(:zoneadm).with(:install)
            @provider.install
        end

        it "should add the install args to the command if they exist" do
            @resource.stubs(:[]).with(:install_args).returns("install args")
            @provider.expects(:zoneadm).with(:install, ["install", "args"])
            @provider.install
        end
    end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puppet-0.24.9 spec/unit/provider/zone/solaris.rb
puppet-0.24.7 spec/unit/provider/zone/solaris.rb
puppet-0.24.8 spec/unit/provider/zone/solaris.rb