spec/backend/exec/build_command_spec.rb in specinfra-2.61.2 vs spec/backend/exec/build_command_spec.rb in specinfra-2.61.3
- old
+ new
@@ -116,11 +116,11 @@
end
context 'test ubuntu with lsb_release command' do
before do
allow(Specinfra.backend).to receive(:run_command) do |args|
- if ['ls /etc/debian_version', 'lsb_release -ir'].include? args
+ if ['cat /etc/debian_version', 'lsb_release -ir'].include? args
double(
:run_command_response,
:success? => true,
:stdout => "Distributor ID:\tUbuntu\nRelease:\t12.04\n"
)
@@ -139,11 +139,11 @@
end
context 'test ubuntu with /etc/lsb-release' do
before do
allow(Specinfra.backend).to receive(:run_command) do |args|
- if ['ls /etc/debian_version', 'cat /etc/lsb-release'].include? args
+ if ['cat /etc/debian_version', 'cat /etc/lsb-release'].include? args
double(
:run_command_response,
:success? => true,
:stdout => <<-EOF
DISTRIB_ID=Ubuntu
@@ -167,22 +167,22 @@
end
context 'test debian (no lsb_release or lsb-release)' do
before do
allow(Specinfra.backend).to receive(:run_command) do |args|
- if args == 'ls /etc/debian_version'
- double :run_command_response, :success? => true, :stdout => nil
+ if args == 'cat /etc/debian_version'
+ double :run_command_response, :success? => true, :stdout => "8.5\n"
elsif args == 'uname -m'
double :run_command_response, :success? => true, :stdout => "x86_64\n"
else
double :run_command_response, :success? => false, :stdout => nil
end
end
end
subject! { os }
it do
expect(Specinfra.backend).to have_received(:run_command).at_least(1).times
- should eq({:family => 'debian', :release => nil, :arch => 'x86_64' })
+ should eq({:family => 'debian', :release => '8.5', :arch => 'x86_64' })
end
end
end