Commit 2c944345 authored by Will Pragnell's avatar Will Pragnell

Fixed Acknowledgements file names

parent 4cdeed68
......@@ -4,6 +4,9 @@ module Pod
class Markdown < Acknowledgements
def save_as(path)
if (path.extname != ".markdown")
path = Pathname.new(path.dirname + "#{path.basename.to_s}.markdown")
end
file = File.new(path, "w")
file.write(licenses)
file.close
......
......@@ -5,6 +5,9 @@ module Pod
require "xcodeproj/xcodeproj_ext"
def save_as(path)
if (path.extname != ".plist")
path = Pathname.new(path.dirname + "#{path.basename.to_s}.plist")
end
Xcodeproj.write_plist(plist, path)
end
......
......@@ -81,7 +81,7 @@ module Pod
pods_for_target = activated_pods_by_target[target_installer.target_definition]
target_installer.install!(pods_for_target, @sandbox)
acknowledgements_path = config.project_pods_root +
"#{target_installer.target_definition.label}-Acknowledgements.plist"
"#{target_installer.target_definition.label}-Acknowledgements"
Generator::Acknowledgements.new(target_installer.target_definition,
pods_for_target).save_as(acknowledgements_path)
end
......
......@@ -29,11 +29,12 @@ describe Pod::Generator::Markdown do
end
it "writes a markdown file to disk" do
path = @sandbox.root + "Pods-Acknowledgements.markdown"
given_path = @sandbox.root + "Pods-Acknowledgements"
expected_path = @sandbox.root + "Pods-Acknowledgements.markdown"
mockFile = mock
mockFile.expects(:write).with(equals(@markdown.licenses))
mockFile.expects(:close)
File.expects(:new).with(equals(path), equals("w")).returns(mockFile)
@markdown.save_as(path)
File.expects(:new).with(equals(expected_path), equals("w")).returns(mockFile)
@markdown.save_as(given_path)
end
end
......@@ -38,8 +38,9 @@ describe Pod::Generator::Plist do
end
it "writes a plist to disk at the given path" do
path = @sandbox.root + "Pods-Acknowledgements.plist"
Xcodeproj.expects(:write_plist).with(equals(@plist.plist), equals(path))
@plist.save_as(path)
given_path = @sandbox.root + "Pods-Acknowledgements"
expected_path = @sandbox.root + "Pods-Acknowledgements.plist"
Xcodeproj.expects(:write_plist).with(equals(@plist.plist), equals(expected_path))
@plist.save_as(given_path)
end
end
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