Sha256: 0e190d67a582c706157264bc2f43db4636a047bb810dbfca41a986b3c6f2db51

Contents?: true

Size: 1.46 KB

Versions: 35

Compression:

Stored size: 1.46 KB

Contents

#!/usr/bin/env rspec
require 'spec_helper'

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

describe zfs do
  properties = [:ensure, :mountpoint, :compression, :copies, :quota, :reservation, :sharenfs, :snapdir]

  properties.each do |property|
    it "should have a #{property} property" do
      zfs.attrclass(property).ancestors.should be_include(Puppet::Property)
    end
  end

  parameters = [:name]

  parameters.each do |parameter|
    it "should have a #{parameter} parameter" do
      zfs.attrclass(parameter).ancestors.should be_include(Puppet::Parameter)
    end
  end

  it "should autorequire the containing zfss and the zpool" do
    provider = mock "provider"
    provider.stubs(:name).returns(:solaris)
    zfs.stubs(:defaultprovider).returns(provider)
    Puppet::Type.type(:zpool).stubs(:defaultprovider).returns(provider)


    foo_pool = Puppet::Type.type(:zpool).new(:name => "foo")

    foo_bar_zfs = Puppet::Type.type(:zfs).new(:name => "foo/bar")
    foo_bar_baz_zfs = Puppet::Type.type(:zfs).new(:name => "foo/bar/baz")
    foo_bar_baz_buz_zfs = Puppet::Type.type(:zfs).new(:name => "foo/bar/baz/buz")

    config = Puppet::Resource::Catalog.new :testing do |conf|
      [foo_pool, foo_bar_zfs, foo_bar_baz_zfs, foo_bar_baz_buz_zfs].each { |resource| conf.add_resource resource }
    end

    req = foo_bar_baz_buz_zfs.autorequire.collect { |edge| edge.source.ref }

    [foo_pool.ref, foo_bar_zfs.ref, foo_bar_baz_zfs.ref].each { |ref| req.include?(ref).should == true }
  end
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
puppet-2.7.26 spec/unit/type/zfs_spec.rb
puppet-2.7.25 spec/unit/type/zfs_spec.rb
puppet-2.7.24 spec/unit/type/zfs_spec.rb
puppet-2.7.23 spec/unit/type/zfs_spec.rb
puppet-2.7.22 spec/unit/type/zfs_spec.rb
puppet-2.7.21 spec/unit/type/zfs_spec.rb
puppet-2.7.20 spec/unit/type/zfs_spec.rb
puppet-2.7.20.rc1 spec/unit/type/zfs_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/type/zfs_spec.rb
puppet-2.7.19 spec/unit/type/zfs_spec.rb
supply_drop-0.11.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/type/zfs_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/puppet-2.7.18/spec/unit/type/zfs_spec.rb
supply_drop-0.10.2 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/type/zfs_spec.rb
puppet-2.7.18 spec/unit/type/zfs_spec.rb
supply_drop-0.10.1 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/type/zfs_spec.rb
supply_drop-0.10.0 examples/vendored-puppet/vendor/puppet-2.7.8/spec/unit/type/zfs_spec.rb
puppet-2.7.17 spec/unit/type/zfs_spec.rb
puppet-2.7.16 spec/unit/type/zfs_spec.rb
puppet-2.7.14 spec/unit/type/zfs_spec.rb
puppet-2.7.13 spec/unit/type/zfs_spec.rb