[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Pieter van de Bruggen
pieter at puppetlabs.com
Tue May 10 08:08:03 UTC 2011
The following commit has been merged in the experimental branch:
commit 7aa8f2252c7b0512c929fb87a6c3a09a952a142a
Author: Pieter van de Bruggen <pieter at puppetlabs.com>
Date: Wed Mar 23 16:10:45 2011 -0700
(#6770) Changing versioning to semver.
More information about the versioning scheme can be found at http://semver.org.
Paired-With: Nick Lewis
diff --git a/lib/puppet/application/configurer.rb b/lib/puppet/application/configurer.rb
index a76aaaf..92c8d69 100644
--- a/lib/puppet/application/configurer.rb
+++ b/lib/puppet/application/configurer.rb
@@ -17,7 +17,7 @@ class Puppet::Application::Configurer < Puppet::Application
end
def run_command
- report = Puppet::Interface.interface(:configurer, 1).synchronize(Puppet[:certname])
- Puppet::Interface.interface(:report, 1).submit(report)
+ report = Puppet::Interface.interface(:configurer, '0.0.1').synchronize(Puppet[:certname])
+ Puppet::Interface.interface(:report, '0.0.1').submit(report)
end
end
diff --git a/lib/puppet/application/interface.rb b/lib/puppet/application/interface.rb
index 99c10dc..3771ece 100644
--- a/lib/puppet/application/interface.rb
+++ b/lib/puppet/application/interface.rb
@@ -81,7 +81,7 @@ class Puppet::Application::Interface < Puppet::Application
end
def actions(indirection)
- return [] unless interface = Puppet::Interface.interface(indirection, 1)
+ return [] unless interface = Puppet::Interface.interface(indirection, '0.0.1')
interface.load_actions
return interface.actions.sort { |a,b| a.to_s <=> b.to_s }
end
diff --git a/lib/puppet/application/interface_base.rb b/lib/puppet/application/interface_base.rb
index 7877283..7d8885b 100644
--- a/lib/puppet/application/interface_base.rb
+++ b/lib/puppet/application/interface_base.rb
@@ -72,10 +72,10 @@ class Puppet::Application::InterfaceBase < Puppet::Application
@type = self.class.name.to_s.sub(/.+:/, '').downcase.to_sym
# TODO: These should be configurable versions.
- unless Puppet::Interface.interface?(@type, 1)
+ unless Puppet::Interface.interface?(@type, '0.0.1')
raise "Could not find version #{1} of interface '#{@type}'"
end
- @interface = Puppet::Interface.interface(@type, 1)
+ @interface = Puppet::Interface.interface(@type, '0.0.1')
@format ||= @interface.default_format
# We copy all of the app options to the interface.
diff --git a/lib/puppet/interface/v1/catalog.rb b/lib/puppet/interface/v0.0.1/catalog.rb
similarity index 86%
rename from lib/puppet/interface/v1/catalog.rb
rename to lib/puppet/interface/v0.0.1/catalog.rb
index 2ba6420..6472062 100644
--- a/lib/puppet/interface/v1/catalog.rb
+++ b/lib/puppet/interface/v0.0.1/catalog.rb
@@ -1,6 +1,6 @@
require 'puppet/interface/indirector'
-Puppet::Interface::Indirector.interface(:catalog, 1) do
+Puppet::Interface::Indirector.interface(:catalog, '0.0.1') do
action(:apply) do
invoke do |catalog|
report = Puppet::Transaction::Report.new("apply")
@@ -28,7 +28,7 @@ Puppet::Interface::Indirector.interface(:catalog, 1) do
facts_to_upload = {:facts_format => :b64_zlib_yaml, :facts => CGI.escape(facts.render(:b64_zlib_yaml))}
catalog = nil
retrieval_duration = thinmark do
- catalog = Puppet::Interface.interface(:catalog, 1).find(certname, facts_to_upload)
+ catalog = Puppet::Interface.interface(:catalog, '0.0.1').find(certname, facts_to_upload)
end
catalog = catalog.to_ral
catalog.finalize
diff --git a/lib/puppet/interface/v1/catalog/select.rb b/lib/puppet/interface/v0.0.1/catalog/select.rb
similarity index 84%
rename from lib/puppet/interface/v1/catalog/select.rb
rename to lib/puppet/interface/v0.0.1/catalog/select.rb
index e37c841..bc65069 100644
--- a/lib/puppet/interface/v1/catalog/select.rb
+++ b/lib/puppet/interface/v0.0.1/catalog/select.rb
@@ -1,5 +1,5 @@
# Select and show a list of resources of a given type.
-Puppet::Interface.interface(:catalog, 1) do
+Puppet::Interface.interface(:catalog, '0.0.1') do
action :select do
invoke do |host,type|
catalog = Puppet::Resource::Catalog.indirection.find(host)
diff --git a/lib/puppet/interface/v0.0.1/certificate.rb b/lib/puppet/interface/v0.0.1/certificate.rb
new file mode 100644
index 0000000..aee123a
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/certificate.rb
@@ -0,0 +1,4 @@
+require 'puppet/interface/indirector'
+
+Puppet::Interface::Indirector.interface(:certificate, '0.0.1') do
+end
diff --git a/lib/puppet/interface/v0.0.1/certificate_request.rb b/lib/puppet/interface/v0.0.1/certificate_request.rb
new file mode 100644
index 0000000..169d6e5
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/certificate_request.rb
@@ -0,0 +1,4 @@
+require 'puppet/interface/indirector'
+
+Puppet::Interface::Indirector.interface(:certificate_request, '0.0.1') do
+end
diff --git a/lib/puppet/interface/v1/certificate_revocation_list.rb b/lib/puppet/interface/v0.0.1/certificate_revocation_list.rb
similarity index 85%
rename from lib/puppet/interface/v1/certificate_revocation_list.rb
rename to lib/puppet/interface/v0.0.1/certificate_revocation_list.rb
index 09efd8c..7f4f517 100644
--- a/lib/puppet/interface/v1/certificate_revocation_list.rb
+++ b/lib/puppet/interface/v0.0.1/certificate_revocation_list.rb
@@ -1,4 +1,4 @@
require 'puppet/interface/indirector'
-Puppet::Interface::Indirector.interface(:certificate_revocation_list, 1) do
+Puppet::Interface::Indirector.interface(:certificate_revocation_list, '0.0.1') do
end
diff --git a/lib/puppet/interface/v1/config.rb b/lib/puppet/interface/v0.0.1/config.rb
similarity index 78%
rename from lib/puppet/interface/v1/config.rb
rename to lib/puppet/interface/v0.0.1/config.rb
index a072e70..2437712 100644
--- a/lib/puppet/interface/v1/config.rb
+++ b/lib/puppet/interface/v0.0.1/config.rb
@@ -1,6 +1,6 @@
require 'puppet/interface'
-Puppet::Interface.interface(:config, 1) do
+Puppet::Interface.interface(:config, '0.0.1') do
action(:print) do
invoke do |*args|
Puppet.settings[:configprint] = args.join(",")
diff --git a/lib/puppet/interface/v0.0.1/configurer.rb b/lib/puppet/interface/v0.0.1/configurer.rb
new file mode 100644
index 0000000..0ab71c4
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/configurer.rb
@@ -0,0 +1,12 @@
+require 'puppet/interface'
+
+Puppet::Interface.interface(:configurer, '0.0.1') do
+ action(:synchronize) do
+ invoke do |certname|
+ facts = Puppet::Interface.interface(:facts, '0.0.1').find(certname)
+ catalog = Puppet::Interface.interface(:catalog, '0.0.1').download(certname, facts)
+ report = Puppet::Interface.interface(:catalog, '0.0.1').apply(catalog)
+ report
+ end
+ end
+end
diff --git a/lib/puppet/interface/v1/facts.rb b/lib/puppet/interface/v0.0.1/facts.rb
similarity index 89%
rename from lib/puppet/interface/v1/facts.rb
rename to lib/puppet/interface/v0.0.1/facts.rb
index 0be23b7..e987d07 100644
--- a/lib/puppet/interface/v1/facts.rb
+++ b/lib/puppet/interface/v0.0.1/facts.rb
@@ -1,7 +1,7 @@
require 'puppet/interface/indirector'
require 'puppet/node/facts'
-Puppet::Interface::Indirector.interface(:facts, 1) do
+Puppet::Interface::Indirector.interface(:facts, '0.0.1') do
set_default_format :yaml
# Upload our facts to the server
diff --git a/lib/puppet/interface/v1/file.rb b/lib/puppet/interface/v0.0.1/file.rb
similarity index 58%
rename from lib/puppet/interface/v1/file.rb
rename to lib/puppet/interface/v0.0.1/file.rb
index 430413a..2f27e43 100644
--- a/lib/puppet/interface/v1/file.rb
+++ b/lib/puppet/interface/v0.0.1/file.rb
@@ -1,5 +1,5 @@
require 'puppet/interface/indirector'
-Puppet::Interface::Indirector.interface(:file, 1) do
+Puppet::Interface::Indirector.interface(:file, '0.0.1') do
set_indirection_name :file_bucket_file
end
diff --git a/lib/puppet/interface/v0.0.1/key.rb b/lib/puppet/interface/v0.0.1/key.rb
new file mode 100644
index 0000000..ddd3a6e
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/key.rb
@@ -0,0 +1,4 @@
+require 'puppet/interface/indirector'
+
+Puppet::Interface::Indirector.interface(:key, '0.0.1') do
+end
diff --git a/lib/puppet/interface/v1/node.rb b/lib/puppet/interface/v0.0.1/node.rb
similarity index 54%
rename from lib/puppet/interface/v1/node.rb
rename to lib/puppet/interface/v0.0.1/node.rb
index c3e5278..8984268 100644
--- a/lib/puppet/interface/v1/node.rb
+++ b/lib/puppet/interface/v0.0.1/node.rb
@@ -1,5 +1,5 @@
require 'puppet/interface/indirector'
-Puppet::Interface::Indirector.interface(:node, 1) do
+Puppet::Interface::Indirector.interface(:node, '0.0.1') do
set_default_format :yaml
end
diff --git a/lib/puppet/interface/v1/report.rb b/lib/puppet/interface/v0.0.1/report.rb
similarity index 84%
rename from lib/puppet/interface/v1/report.rb
rename to lib/puppet/interface/v0.0.1/report.rb
index fdc2e2c..3f4e173 100644
--- a/lib/puppet/interface/v1/report.rb
+++ b/lib/puppet/interface/v0.0.1/report.rb
@@ -1,6 +1,6 @@
require 'puppet/interface/indirector'
-Puppet::Interface::Indirector.interface(:report, 1) do
+Puppet::Interface::Indirector.interface(:report, '0.0.1') do
action(:submit) do
invoke do |report|
begin
diff --git a/lib/puppet/interface/v0.0.1/resource.rb b/lib/puppet/interface/v0.0.1/resource.rb
new file mode 100644
index 0000000..61c90cc
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/resource.rb
@@ -0,0 +1,4 @@
+require 'puppet/interface/indirector'
+
+Puppet::Interface::Indirector.interface(:resource, '0.0.1') do
+end
diff --git a/lib/puppet/interface/v0.0.1/resource_type.rb b/lib/puppet/interface/v0.0.1/resource_type.rb
new file mode 100644
index 0000000..9cc4bef
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/resource_type.rb
@@ -0,0 +1,4 @@
+require 'puppet/interface/indirector'
+
+Puppet::Interface::Indirector.interface(:resource_type, '0.0.1') do
+end
diff --git a/lib/puppet/interface/v0.0.1/status.rb b/lib/puppet/interface/v0.0.1/status.rb
new file mode 100644
index 0000000..d8cded8
--- /dev/null
+++ b/lib/puppet/interface/v0.0.1/status.rb
@@ -0,0 +1,4 @@
+require 'puppet/interface/indirector'
+
+Puppet::Interface::Indirector.interface(:status, '0.0.1') do
+end
diff --git a/lib/puppet/interface/v1/certificate.rb b/lib/puppet/interface/v1/certificate.rb
deleted file mode 100644
index 9a88c62..0000000
--- a/lib/puppet/interface/v1/certificate.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'puppet/interface/indirector'
-
-Puppet::Interface::Indirector.interface(:certificate, 1) do
-end
diff --git a/lib/puppet/interface/v1/certificate_request.rb b/lib/puppet/interface/v1/certificate_request.rb
deleted file mode 100644
index 868933e..0000000
--- a/lib/puppet/interface/v1/certificate_request.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'puppet/interface/indirector'
-
-Puppet::Interface::Indirector.interface(:certificate_request, 1) do
-end
diff --git a/lib/puppet/interface/v1/configurer.rb b/lib/puppet/interface/v1/configurer.rb
deleted file mode 100644
index 1deffce..0000000
--- a/lib/puppet/interface/v1/configurer.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-require 'puppet/interface'
-
-Puppet::Interface.interface(:configurer, 1) do
- action(:synchronize) do
- invoke do |certname|
- facts = Puppet::Interface.interface(:facts, 1).find(certname)
- catalog = Puppet::Interface.interface(:catalog, 1).download(certname, facts)
- report = Puppet::Interface.interface(:catalog, 1).apply(catalog)
- report
- end
- end
-end
diff --git a/lib/puppet/interface/v1/key.rb b/lib/puppet/interface/v1/key.rb
deleted file mode 100644
index fc82f4d..0000000
--- a/lib/puppet/interface/v1/key.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'puppet/interface/indirector'
-
-Puppet::Interface::Indirector.interface(:key, 1) do
-end
diff --git a/lib/puppet/interface/v1/resource.rb b/lib/puppet/interface/v1/resource.rb
deleted file mode 100644
index 20dc283..0000000
--- a/lib/puppet/interface/v1/resource.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'puppet/interface/indirector'
-
-Puppet::Interface::Indirector.interface(:resource, 1) do
-end
diff --git a/lib/puppet/interface/v1/resource_type.rb b/lib/puppet/interface/v1/resource_type.rb
deleted file mode 100644
index f180dc5..0000000
--- a/lib/puppet/interface/v1/resource_type.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'puppet/interface/indirector'
-
-Puppet::Interface::Indirector.interface(:resource_type, 1) do
-end
diff --git a/lib/puppet/interface/v1/status.rb b/lib/puppet/interface/v1/status.rb
deleted file mode 100644
index a2493b5..0000000
--- a/lib/puppet/interface/v1/status.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-require 'puppet/interface/indirector'
-
-Puppet::Interface::Indirector.interface(:status, 1) do
-end
diff --git a/spec/unit/application/interface_base_spec.rb b/spec/unit/application/interface_base_spec.rb
index 6aa9558..3a6966d 100644
--- a/spec/unit/application/interface_base_spec.rb
+++ b/spec/unit/application/interface_base_spec.rb
@@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
require 'puppet/application/interface_base'
require 'puppet/application/interface_base'
-base_interface = Puppet::Interface.interface(:basetest, 1)
+base_interface = Puppet::Interface.interface(:basetest, '0.0.1')
class Puppet::Application::InterfaceBase::Basetest < Puppet::Application::InterfaceBase
end
diff --git a/spec/unit/interface/action_builder_spec.rb b/spec/unit/interface/action_builder_spec.rb
index ba6618f..2c2f3b1 100644
--- a/spec/unit/interface/action_builder_spec.rb
+++ b/spec/unit/interface/action_builder_spec.rb
@@ -13,7 +13,7 @@ describe Puppet::Interface::ActionBuilder do
end
it "should define a method on the interface which invokes the action" do
- interface = Puppet::Interface.new(:action_builder_test_interface, :version => 1)
+ interface = Puppet::Interface.new(:action_builder_test_interface, :version => '0.0.1')
action = Puppet::Interface::ActionBuilder.build(interface, :foo) do
invoke do
"invoked the method"
diff --git a/spec/unit/interface/action_spec.rb b/spec/unit/interface/action_spec.rb
index 5be6665..246ae96 100644
--- a/spec/unit/interface/action_spec.rb
+++ b/spec/unit/interface/action_spec.rb
@@ -24,7 +24,7 @@ describe Puppet::Interface::Action do
describe "when invoking" do
it "should be able to call other actions on the same object" do
- interface = Puppet::Interface.new(:my_interface, :version => 1) do
+ interface = Puppet::Interface.new(:my_interface, :version => '0.0.1') do
action(:foo) do
invoke { 25 }
end
@@ -56,7 +56,7 @@ describe Puppet::Interface::Action do
end
end
- interface = Puppet::Interface::MyInterfaceBaseClass.new(:my_inherited_interface, :version => 1) do
+ interface = Puppet::Interface::MyInterfaceBaseClass.new(:my_inherited_interface, :version => '0.0.1') do
action(:baz) do
invoke { "the value of foo in baz is '#{foo}'" }
end
diff --git a/spec/unit/interface/catalog_spec.rb b/spec/unit/interface/catalog_spec.rb
index a59f9c9..1d33fed 100644
--- a/spec/unit/interface/catalog_spec.rb
+++ b/spec/unit/interface/catalog_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:catalog, 1) do
+describe Puppet::Interface.interface(:catalog, '0.0.1') do
end
diff --git a/spec/unit/interface/certificate_request_spec.rb b/spec/unit/interface/certificate_request_spec.rb
index e818c30..994a19a 100644
--- a/spec/unit/interface/certificate_request_spec.rb
+++ b/spec/unit/interface/certificate_request_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:certificate_request, 1) do
+describe Puppet::Interface.interface(:certificate_request, '0.0.1') do
end
diff --git a/spec/unit/interface/certificate_revocation_list_spec.rb b/spec/unit/interface/certificate_revocation_list_spec.rb
index 0979eda..024770e 100644
--- a/spec/unit/interface/certificate_revocation_list_spec.rb
+++ b/spec/unit/interface/certificate_revocation_list_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:certificate_revocation_list, 1) do
+describe Puppet::Interface.interface(:certificate_revocation_list, '0.0.1') do
end
diff --git a/spec/unit/interface/certificate_spec.rb b/spec/unit/interface/certificate_spec.rb
index 51b79e6..45d33fe 100644
--- a/spec/unit/interface/certificate_spec.rb
+++ b/spec/unit/interface/certificate_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:certificate, 1) do
+describe Puppet::Interface.interface(:certificate, '0.0.1') do
end
diff --git a/spec/unit/interface/config_spec.rb b/spec/unit/interface/config_spec.rb
index e1238b9..20a92bf 100644
--- a/spec/unit/interface/config_spec.rb
+++ b/spec/unit/interface/config_spec.rb
@@ -2,7 +2,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:config, 1) do
+describe Puppet::Interface.interface(:config, '0.0.1') do
it "should use Settings#print_config_options when asked to print" do
Puppet.settings.stubs(:puts)
Puppet.settings.expects(:print_config_options)
diff --git a/spec/unit/interface/configurer_spec.rb b/spec/unit/interface/configurer_spec.rb
index b592a85..589e6be 100644
--- a/spec/unit/interface/configurer_spec.rb
+++ b/spec/unit/interface/configurer_spec.rb
@@ -4,7 +4,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
require 'puppet/indirector/catalog/rest'
require 'tempfile'
-describe Puppet::Interface.interface(:configurer, 1) do
+describe Puppet::Interface.interface(:configurer, '0.0.1') do
describe "#synchronize" do
it "should retrieve and apply a catalog and return a report" do
dirname = Dir.mktmpdir("puppetdir")
diff --git a/spec/unit/interface/facts_spec.rb b/spec/unit/interface/facts_spec.rb
index 2b5731d..4782ecb 100644
--- a/spec/unit/interface/facts_spec.rb
+++ b/spec/unit/interface/facts_spec.rb
@@ -2,7 +2,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:facts, 1) do
+describe Puppet::Interface.interface(:facts, '0.0.1') do
it "should define an 'upload' fact" do
subject.should be_action(:upload)
end
diff --git a/spec/unit/interface/file_spec.rb b/spec/unit/interface/file_spec.rb
index 754b228..4b776fb 100644
--- a/spec/unit/interface/file_spec.rb
+++ b/spec/unit/interface/file_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:file, 1) do
+describe Puppet::Interface.interface(:file, '0.0.1') do
end
diff --git a/spec/unit/interface/indirector_spec.rb b/spec/unit/interface/indirector_spec.rb
index abbff15..b14058e 100644
--- a/spec/unit/interface/indirector_spec.rb
+++ b/spec/unit/interface/indirector_spec.rb
@@ -5,7 +5,7 @@ require 'puppet/interface/indirector'
describe Puppet::Interface::Indirector do
before do
- @instance = Puppet::Interface::Indirector.new(:test, :version => 1)
+ @instance = Puppet::Interface::Indirector.new(:test, :version => '0.0.1')
@indirection = stub 'indirection', :name => :stub_indirection
@@ -24,7 +24,7 @@ describe Puppet::Interface::Indirector do
it "should be able to determine its indirection" do
# Loading actions here an get, um, complicated
Puppet::Interface.stubs(:load_actions)
- Puppet::Interface::Indirector.new(:catalog, :version => 1).indirection.should equal(Puppet::Resource::Catalog.indirection)
+ Puppet::Interface::Indirector.new(:catalog, :version => '0.0.1').indirection.should equal(Puppet::Resource::Catalog.indirection)
end
end
diff --git a/spec/unit/interface/interface_collection_spec.rb b/spec/unit/interface/interface_collection_spec.rb
index ae684ca..193d31b 100644
--- a/spec/unit/interface/interface_collection_spec.rb
+++ b/spec/unit/interface/interface_collection_spec.rb
@@ -20,56 +20,56 @@ describe Puppet::Interface::InterfaceCollection do
describe "::[]" do
before :each do
- subject.instance_variable_get("@interfaces")[:foo][1] = 10
+ subject.instance_variable_get("@interfaces")[:foo]['0.0.1'] = 10
end
it "should return the interface with the given name" do
- subject["foo", 1].should == 10
+ subject["foo", '0.0.1'].should == 10
end
it "should attempt to load the interface if it isn't found" do
- subject.expects(:require).with('puppet/interface/v1/bar')
- subject["bar", 1]
+ subject.expects(:require).with('puppet/interface/v0.0.1/bar')
+ subject["bar", '0.0.1']
end
end
describe "::interface?" do
before :each do
- subject.instance_variable_get("@interfaces")[:foo][1] = 10
+ subject.instance_variable_get("@interfaces")[:foo]['0.0.1'] = 10
end
it "should return true if the interface specified is registered" do
- subject.interface?("foo", 1).should == true
+ subject.interface?("foo", '0.0.1').should == true
end
it "should attempt to require the interface if it is not registered" do
- subject.expects(:require).with('puppet/interface/v1/bar')
- subject.interface?("bar", 1)
+ subject.expects(:require).with('puppet/interface/v0.0.1/bar')
+ subject.interface?("bar", '0.0.1')
end
it "should return true if requiring the interface registered it" do
subject.stubs(:require).with do
- subject.instance_variable_get("@interfaces")[:bar][1] = 20
+ subject.instance_variable_get("@interfaces")[:bar]['0.0.1'] = 20
end
- subject.interface?("bar", 1).should == true
+ subject.interface?("bar", '0.0.1').should == true
end
it "should return false if the interface is not registered" do
subject.stubs(:require).returns(true)
- subject.interface?("bar", 1).should == false
+ subject.interface?("bar", '0.0.1').should == false
end
it "should return false if there is a LoadError requiring the interface" do
subject.stubs(:require).raises(LoadError)
- subject.interface?("bar", 1).should == false
+ subject.interface?("bar", '0.0.1').should == false
end
end
describe "::register" do
it "should store the interface by name" do
- interface = Puppet::Interface.new(:my_interface, :version => 1)
+ interface = Puppet::Interface.new(:my_interface, :version => '0.0.1')
subject.register(interface)
- subject.instance_variable_get("@interfaces").should == {:my_interface => {1 => interface}}
+ subject.instance_variable_get("@interfaces").should == {:my_interface => {'0.0.1' => interface}}
end
end
diff --git a/spec/unit/interface/key_spec.rb b/spec/unit/interface/key_spec.rb
index 395fbef..8c950ba 100644
--- a/spec/unit/interface/key_spec.rb
+++ b/spec/unit/interface/key_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:key, 1) do
+describe Puppet::Interface.interface(:key, '0.0.1') do
end
diff --git a/spec/unit/interface/node_spec.rb b/spec/unit/interface/node_spec.rb
index bd4bc9f..1040818 100644
--- a/spec/unit/interface/node_spec.rb
+++ b/spec/unit/interface/node_spec.rb
@@ -2,7 +2,7 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:node, 1) do
+describe Puppet::Interface.interface(:node, '0.0.1') do
it "should set its default format to :yaml" do
subject.default_format.should == :yaml
end
diff --git a/spec/unit/interface/report_spec.rb b/spec/unit/interface/report_spec.rb
index 0dd3cac..0a7acfa 100644
--- a/spec/unit/interface/report_spec.rb
+++ b/spec/unit/interface/report_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:report, 1) do
+describe Puppet::Interface.interface(:report, '0.0.1') do
end
diff --git a/spec/unit/interface/resource_spec.rb b/spec/unit/interface/resource_spec.rb
index 5101ddb..afaed67 100644
--- a/spec/unit/interface/resource_spec.rb
+++ b/spec/unit/interface/resource_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:resource, 1) do
+describe Puppet::Interface.interface(:resource, '0.0.1') do
end
diff --git a/spec/unit/interface/resource_type_spec.rb b/spec/unit/interface/resource_type_spec.rb
index 84afa30..f689acc 100644
--- a/spec/unit/interface/resource_type_spec.rb
+++ b/spec/unit/interface/resource_type_spec.rb
@@ -2,5 +2,5 @@
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper.rb')
-describe Puppet::Interface.interface(:resource_type, 1) do
+describe Puppet::Interface.interface(:resource_type, '0.0.1') do
end
diff --git a/spec/unit/interface_spec.rb b/spec/unit/interface_spec.rb
index b78a9f8..eaeb4c4 100755
--- a/spec/unit/interface_spec.rb
+++ b/spec/unit/interface_spec.rb
@@ -17,13 +17,13 @@ describe Puppet::Interface do
describe "#interface" do
it "should register the interface" do
- interface = Puppet::Interface.interface(:interface_test_register, 1)
- interface.should == Puppet::Interface.interface(:interface_test_register, 1)
+ interface = Puppet::Interface.interface(:interface_test_register, '0.0.1')
+ interface.should == Puppet::Interface.interface(:interface_test_register, '0.0.1')
end
it "should load actions" do
Puppet::Interface.any_instance.expects(:load_actions)
- Puppet::Interface.interface(:interface_test_load_actions, 1)
+ Puppet::Interface.interface(:interface_test_load_actions, '0.0.1')
end
it "should require a version number" do
@@ -37,7 +37,7 @@ describe Puppet::Interface do
end
it "should instance-eval any provided block" do
- face = Puppet::Interface.new(:interface_test_block, :version => 1) do
+ face = Puppet::Interface.new(:interface_test_block, :version => '0.0.1') do
action(:something) do
invoke { "foo" }
end
@@ -48,21 +48,21 @@ describe Puppet::Interface do
end
it "should have a name" do
- Puppet::Interface.new(:me, :version => 1).name.should == :me
+ Puppet::Interface.new(:me, :version => '0.0.1').name.should == :me
end
it "should stringify with its own name" do
- Puppet::Interface.new(:me, :version => 1).to_s.should =~ /\bme\b/
+ Puppet::Interface.new(:me, :version => '0.0.1').to_s.should =~ /\bme\b/
end
it "should allow overriding of the default format" do
- face = Puppet::Interface.new(:me, :version => 1)
+ face = Puppet::Interface.new(:me, :version => '0.0.1')
face.set_default_format :foo
face.default_format.should == :foo
end
it "should default to :pson for its format" do
- Puppet::Interface.new(:me, :version => 1).default_format.should == :pson
+ Puppet::Interface.new(:me, :version => '0.0.1').default_format.should == :pson
end
# Why?
@@ -75,8 +75,8 @@ describe Puppet::Interface do
end
it "should try to require interfaces that are not known" do
- Puppet::Interface::InterfaceCollection.expects(:require).with "puppet/interface/v1/foo"
- Puppet::Interface.interface(:foo, 1)
+ Puppet::Interface::InterfaceCollection.expects(:require).with "puppet/interface/v0.0.1/foo"
+ Puppet::Interface.interface(:foo, '0.0.1')
end
it "should be able to load all actions in all search paths"
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list