summaryrefslogtreecommitdiff
path: root/spec/unit/module_tool/applications/upgrader_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/module_tool/applications/upgrader_spec.rb')
-rw-r--r--spec/unit/module_tool/applications/upgrader_spec.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/module_tool/applications/upgrader_spec.rb b/spec/unit/module_tool/applications/upgrader_spec.rb
index 44627f94f..382e45a75 100644
--- a/spec/unit/module_tool/applications/upgrader_spec.rb
+++ b/spec/unit/module_tool/applications/upgrader_spec.rb
@@ -52,6 +52,16 @@ describe Puppet::ModuleTool::Applications::Upgrader do
end
context 'for an installed module' do
+ context 'with only one version' do
+ before { preinstall('puppetlabs-oneversion', '0.0.1') }
+ let(:module) { 'puppetlabs-oneversion' }
+
+ it 'declines to upgrade' do
+ subject.should include :result => :noop
+ subject[:error][:multiline].should =~ /already the latest version/
+ end
+ end
+
context 'without dependencies' do
before { preinstall('pmtacceptance-stdlib', '1.0.0') }
@@ -90,6 +100,7 @@ describe Puppet::ModuleTool::Applications::Upgrader do
context 'without options' do
it 'declines to upgrade' do
subject.should include :result => :noop
+ subject[:error][:multiline].should =~ /already the latest version/
end
end
@@ -165,6 +176,17 @@ describe Puppet::ModuleTool::Applications::Upgrader do
subject.should include :result => :failure
subject[:error].should include :oneline => "Could not upgrade '#{self.module}'; module has had changes made locally"
end
+
+ context 'with --ignore-changes' do
+ def options
+ super.merge(:ignore_changes => true)
+ end
+
+ it 'overwrites the installed module with the greatest version matching that range' do
+ subject.should include :result => :success
+ graph_should_include 'pmtacceptance-stdlib', v('1.0.0') => v('4.1.0')
+ end
+ end
end
context 'with dependencies' do