Commit acd55a06 authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Acknowledgements::Plist] Fix sanitization of license text

Now it doesn't strip out characters such as © and –
parent f985eb04
...@@ -74,7 +74,7 @@ module Pod ...@@ -74,7 +74,7 @@ module Pod
# #
def sanitize_encoding(text) def sanitize_encoding(text)
if RUBY_VERSION >= '1.9' if RUBY_VERSION >= '1.9'
text.encode('UTF-8', 'binary', :invalid => :replace, :undef => :replace, :replace => '') text.encode('UTF-8', :invalid => :replace, :undef => :replace, :replace => '')
else else
text text
end end
......
...@@ -27,6 +27,18 @@ describe Pod::Generator::Plist do ...@@ -27,6 +27,18 @@ describe Pod::Generator::Plist do
} }
end end
if RUBY_VERSION >= '1.9'
it 'returns a correctly sanitized license hash for each pod' do
license_text = 'Copyright © 2013–2014 Boris Bügling'
@generator.stubs(:license_text).returns(license_text)
@generator.hash_for_spec(@spec).should == {
:Type => 'PSGroupSpecifier',
:Title => 'POD_NAME',
:FooterText => license_text,
}
end
end
it 'returns nil for a pod with no license text' do it 'returns nil for a pod with no license text' do
@generator.expects(:license_text).returns(nil) @generator.expects(:license_text).returns(nil)
@generator.hash_for_spec(@spec).should.be.nil @generator.hash_for_spec(@spec).should.be.nil
......
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