Skip to content

Commit

Permalink
Added puppet module metadata for the forge.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosen committed Feb 16, 2012
1 parent bfb884a commit 89a67fc
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Modulefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name 'cups'
author 'mosen'
description 'CUPS printer management'
source 'https://github.com/mosen/puppet-cups.git'
summary 'This module manages printers and printer default options in CUPS via the cups command line utilities'
license 'GPLv3'
version '0.0.1'
Empty file.
Empty file added spec/unit/provider/cups_spec.rb
Empty file.
Empty file.
47 changes: 47 additions & 0 deletions spec/unit/type/printer_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env rspec

# TODO: cant require spec_helper outside of puppet tree?

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

describe printer do
before do
#ENV["PATH"] += File::PATH_SEPARATOR + "/usr/sbin" unless ENV["PATH"].split(File::PATH_SEPARATOR).include?("/usr/sbin")
@provider = stub 'provider'
#@resource = stub 'resource', :resource => nil, :provider => @provider, :line => nil, :file => nil
end

it "should have a default provider inheriting from Puppet::Provider" do
printer.defaultprovider.ancestors.should be_include(Puppet::Provider)
end

it "should be able to create a instance" do
printer.new(:name => "foo").should_not be_nil
end

describe "instances" do
it "should have a valid provider" do
printer.new(:name => "foo").provider.class.ancestors.should be_include(Puppet::Provider)
end

it "should delegate existence questions to its provider" do
instance = printer.new(:name => "foo")
instance.provider.expects(:exists?).returns "eh"
instance.exists?.should == "eh"
end
end

properties = [:ensure, :name, :uri, :description, :location, :ppd, :enabled, :shared, :options]

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

it "should have documentation for its #{property} property" do
printer.attrclass(property).doc.should be_instance_of(String)
end
end


end

0 comments on commit 89a67fc

Please sign in to comment.