Commit 868bb664 authored by Jay Mundrawala's avatar Jay Mundrawala
Browse files

Merge pull request #536 from chef/jdm/package-name-win-arch

Add architecture to package name on windows
parents 4bb5b596 6a909af7
...@@ -321,11 +321,11 @@ module Omnibus ...@@ -321,11 +321,11 @@ module Omnibus
end end
def msi_name def msi_name
"#{project.package_name}-#{project.build_version}-#{project.build_iteration}.msi" "#{project.package_name}-#{project.build_version}-#{project.build_iteration}-#{Config.windows_arch}.msi"
end end
def bundle_name def bundle_name
"#{project.package_name}-#{project.build_version}-#{project.build_iteration}.exe" "#{project.package_name}-#{project.build_version}-#{project.build_iteration}-#{Config.windows_arch}.exe"
end end
# #
......
...@@ -90,13 +90,17 @@ module Omnibus ...@@ -90,13 +90,17 @@ module Omnibus
end end
describe '#package_name' do describe '#package_name' do
before do
allow(Config).to receive(:windows_arch).and_return(:foo_arch)
end
it 'includes the name, version, and build iteration' do it 'includes the name, version, and build iteration' do
expect(subject.package_name).to eq('project-1.2.3-2.msi') expect(subject.package_name).to eq('project-1.2.3-2-foo_arch.msi')
end end
it 'returns the bundle name when building a bundle' do it 'returns the bundle name when building a bundle' do
subject.bundle_msi(true) subject.bundle_msi(true)
expect(subject.package_name).to eq('project-1.2.3-2.exe') expect(subject.package_name).to eq('project-1.2.3-2-foo_arch.exe')
end end
end end
...@@ -181,6 +185,7 @@ module Omnibus ...@@ -181,6 +185,7 @@ module Omnibus
before do before do
subject.bundle_msi(true) subject.bundle_msi(true)
subject.upgrade_code('ABCD-1234') subject.upgrade_code('ABCD-1234')
allow(Config).to receive(:windows_arch).and_return(:x86)
end end
it 'generates the file' do it 'generates the file' do
...@@ -189,7 +194,7 @@ module Omnibus ...@@ -189,7 +194,7 @@ module Omnibus
end end
it 'has the correct content' do it 'has the correct content' do
outpath = "#{tmp_path}/package/dir/project-1.2.3-2.msi" outpath = "#{tmp_path}/package/dir/project-1.2.3-2-x86.msi"
outpath = outpath.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if windows? outpath = outpath.gsub(File::SEPARATOR, File::ALT_SEPARATOR) if windows?
subject.write_bundle_file subject.write_bundle_file
contents = File.read("#{staging_dir}/bundle.wxs") contents = File.read("#{staging_dir}/bundle.wxs")
......
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