Commit 39b80011 authored by Andrea Mazzini's avatar Andrea Mazzini

Add new_version_message test

parent 9cc5c62b
......@@ -22,7 +22,7 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#3101](https://github.com/CocoaPods/CocoaPods/issues/3101)
* Add environment variable `COCOAPODS_SKIP_NEW_VERSION` to disable new
* Add environment variable `COCOAPODS_SKIP_UPDATE_MESSAGE` to disable new
version message
[Andrea Mazzini](https://github.com/andreamazz)
[#3364](https://github.com/CocoaPods/CocoaPods/issues/3364)
......
......@@ -19,7 +19,7 @@ module Pod
:clean => true,
:integrate_targets => true,
:new_version_message => ENV['COCOAPODS_SKIP_NEW_VERSION'].nil?,
:new_version_message => ENV['COCOAPODS_SKIP_UPDATE_MESSAGE'].nil?,
:cache_root => Pathname.new(Dir.home) + 'Library/Caches/CocoaPods',
}
......
......@@ -268,6 +268,13 @@ module Pod
UI.output.should.match /CocoaPods 999.0 is available/
end
it 'skips the update message if the user disabled the notification' do
config.new_version_message = false
SourcesManager.stubs(:version_information).returns('last' => '999.0')
SourcesManager.check_version_information(temporary_directory)
UI.output.should.not.match /CocoaPods 999.0 is available/
end
it 'raises while asked to version information of a source if it is not compatible' do
SourcesManager.stubs(:version_information).returns('min' => '999.0')
e = lambda { SourcesManager.check_version_information(temporary_directory) }.should.raise Informative
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment