diff options
| author | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-23 16:10:45 -0700 |
|---|---|---|
| committer | Pieter van de Bruggen <pieter@puppetlabs.com> | 2011-03-23 16:10:45 -0700 |
| commit | 7aa8f2252c7b0512c929fb87a6c3a09a952a142a (patch) | |
| tree | 0e65699d002c28ba0abacfaf41b693519fc2ef6f | |
| parent | 1187a0eb2550f04d9b6c3dcfdcacdfbb32de0e56 (diff) | |
| download | puppet-7aa8f2252c7b0512c929fb87a6c3a09a952a142a.tar.gz puppet-7aa8f2252c7b0512c929fb87a6c3a09a952a142a.tar.xz puppet-7aa8f2252c7b0512c929fb87a6c3a09a952a142a.zip | |
(#6770) Changing versioning to semver.
More information about the versioning scheme can be found at http://semver.org.
Paired-With: Nick Lewis
44 files changed, 93 insertions, 93 deletions
diff --git a/lib/puppet/application/configurer.rb b/lib/puppet/application/configurer.rb index a76aaaf01..92c8d69d0 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 99c10dc16..3771ecead 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 78772833e..7d8885b3f 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 index 2ba642039..647206251 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 index e37c841b5..bc65069b8 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 000000000..aee123aa6 --- /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 000000000..169d6e500 --- /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 index 09efd8c7a..7f4f5176b 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 index a072e703c..2437712ca 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 000000000..0ab71c47a --- /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 index 0be23b781..e987d0740 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 index 430413a56..2f27e434f 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 000000000..ddd3a6ea8 --- /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 index c3e527856..898426846 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 index fdc2e2c0f..3f4e17310 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 000000000..61c90cc85 --- /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 000000000..9cc4bef28 --- /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 000000000..d8cded899 --- /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 9a88c628a..000000000 --- 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 868933e1f..000000000 --- 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 1deffce4e..000000000 --- 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 fc82f4d68..000000000 --- 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 20dc2837c..000000000 --- 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 f180dc576..000000000 --- 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 a2493b581..000000000 --- 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 6aa9558df..3a6966d10 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 ba6618fa4..2c2f3b14c 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 5be6665fb..246ae9622 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 a59f9c952..1d33fed38 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 e818c301b..994a19a55 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 0979eda1f..024770e20 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 51b79e6b0..45d33feec 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 e1238b925..20a92bf47 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 b592a85bb..589e6be95 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 2b5731de5..4782ecb85 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 754b22875..4b776fbbc 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 abbff150b..b14058eca 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 ae684ca75..193d31b1e 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 395fbef4d..8c950baa1 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 bd4bc9fea..104081838 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 0dd3cacf1..0a7acfac3 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 5101ddbd6..afaed67b7 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 84afa30d4..f689accc3 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 b78a9f8c8..eaeb4c4ce 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" |
