Commit db6b6e9b authored by Ryan Hass's avatar Ryan Hass

Fixup rpm_spec to ensure correct arch in tests

We need to ensure the value used in the test string is one which is
presented from ohai. This mocks the ohai value to ensure it does not
fail the test if run on non x86_64 architectures.
parent 938a7190
......@@ -19,6 +19,7 @@ module Omnibus
let(:project_root) { File.join(tmp_path, 'project/root') }
let(:package_dir) { File.join(tmp_path, 'package/dir') }
let(:staging_dir) { File.join(tmp_path, 'staging/dir') }
let(:architecture) { 'x86_64' }
before do
Config.project_root(project_root)
......@@ -32,7 +33,9 @@ module Omnibus
create_directory("#{staging_dir}/SOURCES")
create_directory("#{staging_dir}/SPECS")
stub_ohai(platform: 'redhat', version: '6.5')
stub_ohai(platform: 'redhat', version: '6.5') do |data|
data['kernel']['machine'] = architecture
end
end
describe '#signing_passphrase' do
......@@ -251,7 +254,7 @@ module Omnibus
it 'uses the correct command' do
expect(subject).to receive(:shellout!)
.with(/rpmbuild --target x86_64 -bb --buildroot/)
.with(/rpmbuild --target #{architecture} -bb --buildroot/)
subject.create_rpm_file
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