diff options
author | Stig Sandbeck Mathisen <ssm@debian.org> | 2014-09-07 10:14:36 +0200 |
---|---|---|
committer | Stig Sandbeck Mathisen <ssm@debian.org> | 2014-09-07 10:14:36 +0200 |
commit | d4b83be375ac1dead058e091191ee7c7b7c24c8a (patch) | |
tree | dc825687392ae3068de5b764be60c53122d9e02a /spec/unit/module_tool/applications/upgrader_spec.rb | |
parent | 229cbb976fe0f70f5f30548b83517b415840f9bb (diff) | |
parent | 1681684857c6e39d60d87b0b3520d8783977ceff (diff) | |
download | puppet-upstream/3.7.0.tar.gz |
Imported Upstream version 3.7.0upstream/3.7.0
Diffstat (limited to 'spec/unit/module_tool/applications/upgrader_spec.rb')
-rw-r--r-- | spec/unit/module_tool/applications/upgrader_spec.rb | 22 |
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 |