Commit 5b21047e authored by Danielle Tomlinson's avatar Danielle Tomlinson Committed by GitHub

Merge pull request #6059 from CocoaPods/dani_strip_newlines

[Validator] Strip newlines from .swift-version files
parents 670952b5 cc982424
...@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,7 +12,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* None. * Strip newlines from .swift-version files.
[Danielle Tomlinson](https://github.com/dantoml)
[#6059](https://github.com/CocoaPods/CocoaPods/pull/6059)
## 1.1.0 (2016-10-19) ## 1.1.0 (2016-10-19)
......
...@@ -259,7 +259,7 @@ module Pod ...@@ -259,7 +259,7 @@ module Pod
# #
def dot_swift_version def dot_swift_version
swift_version_path = file.dirname + '.swift-version' swift_version_path = file.dirname + '.swift-version'
swift_version_path.read if swift_version_path.exist? swift_version_path.read.strip if swift_version_path.exist?
end end
# @return [String] A string representing the Swift version used during linting # @return [String] A string representing the Swift version used during linting
......
...@@ -867,6 +867,13 @@ module Pod ...@@ -867,6 +867,13 @@ module Pod
Pathname.any_instance.expects(:read).returns('1.0') Pathname.any_instance.expects(:read).returns('1.0')
validator.dot_swift_version.should == '1.0' validator.dot_swift_version.should == '1.0'
end end
it 'strips newlines from .swift-version files' do
validator = test_swiftpod
Pathname.any_instance.stubs(:exist?).returns(true)
Pathname.any_instance.stubs(:read).returns("2.1\n")
validator.swift_version.should == '2.1'
end
end end
describe 'Getting the Swift value used by the validator' do describe 'Getting the Swift value used by the validator' do
......
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