summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorPieter van de Bruggen <pieter@puppetlabs.com>2011-03-23 16:10:45 -0700
committerPieter van de Bruggen <pieter@puppetlabs.com>2011-03-23 16:10:45 -0700
commit7aa8f2252c7b0512c929fb87a6c3a09a952a142a (patch)
tree0e65699d002c28ba0abacfaf41b693519fc2ef6f /spec
parent1187a0eb2550f04d9b6c3dcfdcacdfbb32de0e56 (diff)
downloadpuppet-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
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/application/interface_base_spec.rb2
-rw-r--r--spec/unit/interface/action_builder_spec.rb2
-rw-r--r--spec/unit/interface/action_spec.rb4
-rw-r--r--spec/unit/interface/catalog_spec.rb2
-rw-r--r--spec/unit/interface/certificate_request_spec.rb2
-rw-r--r--spec/unit/interface/certificate_revocation_list_spec.rb2
-rw-r--r--spec/unit/interface/certificate_spec.rb2
-rw-r--r--spec/unit/interface/config_spec.rb2
-rw-r--r--spec/unit/interface/configurer_spec.rb2
-rw-r--r--spec/unit/interface/facts_spec.rb2
-rw-r--r--spec/unit/interface/file_spec.rb2
-rw-r--r--spec/unit/interface/indirector_spec.rb4
-rw-r--r--spec/unit/interface/interface_collection_spec.rb28
-rw-r--r--spec/unit/interface/key_spec.rb2
-rw-r--r--spec/unit/interface/node_spec.rb2
-rw-r--r--spec/unit/interface/report_spec.rb2
-rw-r--r--spec/unit/interface/resource_spec.rb2
-rw-r--r--spec/unit/interface/resource_type_spec.rb2
-rwxr-xr-xspec/unit/interface_spec.rb20
19 files changed, 43 insertions, 43 deletions
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"