File: package_spec.rb

package info (click to toggle)
ruby-specinfra 2.94.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,448 kB
  • sloc: ruby: 10,538; sh: 4; makefile: 4
file content (32 lines) | stat: -rw-r--r-- 1,063 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'spec_helper'

property[:os] = nil
set :os, :family => 'amazon', :release => '2022'

describe  get_command(:check_package_is_installed, 'telnet') do
  it { should eq 'rpm -q telnet' }
end

describe  get_command(:check_package_is_installed, 'telnet', '0.17-48.el6.x86_64') do
  it { should eq 'rpm -q telnet | grep -w -- telnet\\-0\\.17\\-48\\.el6\\.x86_64' }
end

describe  get_command(:check_package_is_installed, 'linux-headers-$(uname -r)') do
  it 'should be escaped (that is, command substitution should not work' do
    should eq 'rpm -q linux-headers-\\$\\(uname\\ -r\\)'
  end
end

describe get_command(:install_package, 'telnet') do
  it { should eq "dnf -y  install telnet" }
end

describe get_command(:install_package, 'telnet', '0.17-48.el6.x86_64') do
  it { should eq "dnf -y  install telnet-0.17-48.el6.x86_64" }
end

describe get_command(:install_package, 'linux-headers-$(uname -r)') do
  it 'should be escaped (that is, command substitution should no work)' do
    should eq "dnf -y  install linux-headers-\\$\\(uname\\ -r\\)"
  end
end