linux_admin 1.2.2 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/linux_admin.rb +0 -8
  4. data/lib/linux_admin/chrony.rb +1 -0
  5. data/lib/linux_admin/disk.rb +31 -8
  6. data/lib/linux_admin/fstab.rb +29 -14
  7. data/lib/linux_admin/partition.rb +1 -1
  8. data/lib/linux_admin/registration_system.rb +8 -4
  9. data/lib/linux_admin/scap.rb +1 -1
  10. data/lib/linux_admin/service/sys_v_init_service.rb +2 -1
  11. data/lib/linux_admin/service/systemd_service.rb +6 -2
  12. data/lib/linux_admin/version.rb +1 -1
  13. metadata +36 -122
  14. data/lib/linux_admin/registration_system/rhn.rb +0 -111
  15. data/spec/chrony_spec.rb +0 -64
  16. data/spec/common_spec.rb +0 -37
  17. data/spec/data/rhn/output_rhn-channel_list +0 -2
  18. data/spec/data/rhn/output_rhn-channel_list_available +0 -4
  19. data/spec/data/rhn/systemid +0 -57
  20. data/spec/data/rhn/systemid.missing_system_id +0 -57
  21. data/spec/data/rpm/cmd_output_for_list_installed +0 -20
  22. data/spec/data/subscription_manager/output_list_all_available +0 -42
  23. data/spec/data/subscription_manager/output_list_installed_not_subscribed +0 -19
  24. data/spec/data/subscription_manager/output_list_installed_subscribed +0 -19
  25. data/spec/data/subscription_manager/output_orgs +0 -6
  26. data/spec/data/subscription_manager/output_repos +0 -18
  27. data/spec/data/time_date/timedatectl_output +0 -14
  28. data/spec/data/yum/first.repo +0 -19
  29. data/spec/data/yum/output_repo_list +0 -13
  30. data/spec/data/yum/output_repoquery_multiple +0 -3
  31. data/spec/data/yum/output_repoquery_single +0 -1
  32. data/spec/data/yum/second.repo +0 -9
  33. data/spec/deb_spec.rb +0 -52
  34. data/spec/disk_spec.rb +0 -246
  35. data/spec/distro_spec.rb +0 -77
  36. data/spec/dns_spec.rb +0 -105
  37. data/spec/etc_issue_spec.rb +0 -37
  38. data/spec/fstab_spec.rb +0 -66
  39. data/spec/hardware_spec.rb +0 -46
  40. data/spec/hosts_spec.rb +0 -150
  41. data/spec/ip_address_spec.rb +0 -148
  42. data/spec/logical_volume_spec.rb +0 -166
  43. data/spec/mountable_spec.rb +0 -182
  44. data/spec/network_interface/network_interface_rh_spec.rb +0 -291
  45. data/spec/network_interface_spec.rb +0 -284
  46. data/spec/partition_spec.rb +0 -24
  47. data/spec/physical_volume_spec.rb +0 -101
  48. data/spec/registration_system_spec.rb +0 -85
  49. data/spec/rhn_spec.rb +0 -144
  50. data/spec/rpm_spec.rb +0 -85
  51. data/spec/scap_spec.rb +0 -48
  52. data/spec/service/sys_v_init_service_spec.rb +0 -127
  53. data/spec/service/systemd_service_spec.rb +0 -133
  54. data/spec/service_spec.rb +0 -54
  55. data/spec/spec_helper.rb +0 -116
  56. data/spec/ssh_spec.rb +0 -53
  57. data/spec/subscription_manager_spec.rb +0 -228
  58. data/spec/system_spec.rb +0 -15
  59. data/spec/time_date_spec.rb +0 -106
  60. data/spec/volume_group_spec.rb +0 -99
  61. data/spec/yum_spec.rb +0 -155
@@ -1,6 +0,0 @@
1
- +-------------------------------------------+
2
- myUser Organizations
3
- +-------------------------------------------+
4
-
5
- Name: SomeOrg
6
- Key: 1234567
@@ -1,18 +0,0 @@
1
- +----------------------------------------------------------+
2
- Available Repositories in /etc/yum.repos.d/redhat.repo
3
- +----------------------------------------------------------+
4
- Repo ID: some-repo-source-rpms
5
- Repo Name: Some Repo (Source RPMs)
6
- Repo URL: https://my.host.example.com/repos/some-repo/source/rpms
7
- Enabled: 1
8
-
9
- Repo ID: some-repo-rpms
10
- Repo Name: Some Repo
11
- Repo URL: https://my.host.example.com/repos/some-repo/rpms
12
- Enabled: 1
13
-
14
- Repo ID: some-repo-2-beta-rpms
15
- Repo Name: Some Repo (Beta RPMs)
16
- Repo URL: https://my.host.example.com/repos/some-repo-2/beta/rpms
17
- Enabled: 0
18
-
@@ -1,14 +0,0 @@
1
- Local time: Thu 2015-09-24 17:54:02 EDT
2
- Universal time: Thu 2015-09-24 21:54:02 UTC
3
- RTC time: Thu 2015-09-24 21:54:02
4
- Time zone: America/New_York (EDT, -0400)
5
- NTP enabled: yes
6
- NTP synchronized: yes
7
- RTC in local TZ: no
8
- DST active: yes
9
- Last DST change: DST began at
10
- Sun 2015-03-08 01:59:59 EST
11
- Sun 2015-03-08 03:00:00 EDT
12
- Next DST change: DST ends (the clock jumps one hour backwards) at
13
- Sun 2015-11-01 01:59:59 EDT
14
- Sun 2015-11-01 01:00:00 EST
@@ -1,19 +0,0 @@
1
- [my-local-repo-a]
2
- name = My Local Repo A
3
- baseurl = https://mirror.example.com/a/content/os_ver
4
- enabled = 0
5
- gpgcheck = 1
6
- gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-my-local-server
7
- sslverify = 1
8
- sslcacert = /etc/rhsm/ca/my-loacl-server.pem
9
- sslclientkey = /etc/pki/entitlement/0123456789012345678-key.pem
10
- sslclientcert = /etc/pki/entitlement/0123456789012345678.pem
11
- metadata_expire = 86400
12
-
13
- [my-local-repo-b]
14
- name = My Local Repo B
15
- baseurl = https://mirror.example.com/b/content/os_ver
16
- enabled = 1
17
- gpgcheck = 0
18
- sslverify = 0
19
- metadata_expire = 86400
@@ -1,13 +0,0 @@
1
- Loaded plugins: product-id, rhnplugin, security, subscription-manager
2
- This system is receiving updates from Red Hat Subscription Management.
3
- This system is not registered with RHN Classic or RHN Satellite.
4
- You can use rhn_register to register.
5
- RHN Satellite or RHN Classic support will be disabled.
6
- rhel-6-server-rpms | 3.7 kB 00:00
7
- rhel-ha-for-rhel-6-server-rpms | 3.7 kB 00:00
8
- rhel-lb-for-rhel-6-server-rpms | 3.7 kB 00:00
9
- repo id repo name status
10
- rhel-6-server-rpms Red Hat Enterprise Linux 6 Server (RPMs) 11,016
11
- rhel-ha-for-rhel-6-server-rpms Red Hat Enterprise Linux High Availability (for RHEL 6 Server) (RPMs) 269
12
- rhel-lb-for-rhel-6-server-rpms Red Hat Enterprise Linux Load Balancer (for RHEL 6 Server) (RPMs) 0
13
- repolist: 11,909
@@ -1,3 +0,0 @@
1
- curl 7.19.7
2
- subscription-manager 1.1.23.1
3
- wget 1.12
@@ -1 +0,0 @@
1
- subscription-manager 1.1.23.1
@@ -1,9 +0,0 @@
1
- [my-local-repo-c]
2
- name=My Local Repo c
3
- baseurl=https://mirror.example.com/c/content/os_ver
4
- enabled=0
5
- cost=100
6
- gpgcheck=1
7
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-my-local-server
8
- sslverify=0
9
- metadata_expire=1
@@ -1,52 +0,0 @@
1
- describe LinuxAdmin::Deb do
2
- describe "#info" do
3
- it "returns package metadata" do
4
- # as output w/ apt-cache show ruby on ubuntu 13.04
5
- data = <<EOS
6
- Package: ruby
7
- Priority: optional
8
- Section: interpreters
9
- Installed-Size: 31
10
- Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
11
- Original-Maintainer: akira yamada <akira@debian.org>
12
- Architecture: all
13
- Source: ruby-defaults
14
- Version: 4.9
15
- Replaces: irb, rdoc
16
- Provides: irb, rdoc
17
- Depends: ruby1.9.1 (>= 1.9.3.194-1)
18
- Suggests: ri, ruby-dev
19
- Conflicts: irb, rdoc
20
- Filename: pool/main/r/ruby-defaults/ruby_4.9_all.deb
21
- Size: 4896
22
- MD5sum: b1991f2e0eafb04f5930ed242cfe1476
23
- SHA1: a7c55fbb83dd8382631ea771b5555d989351f840
24
- SHA256: 84d042e0273bd2f0082dd9e7dda0246267791fd09607041a35485bfff92f38d9
25
- Description-en: Interpreter of object-oriented scripting language Ruby (default version)
26
- Ruby is the interpreted scripting language for quick and easy
27
- object-oriented programming. It has many features to process text
28
- files and to do system management tasks (as in perl). It is simple,
29
- straight-forward, and extensible.
30
- .
31
- This package is a dependency package, which depends on Debian's default Ruby
32
- version (currently v1.9.3).
33
- Homepage: http://www.ruby-lang.org/
34
- Description-md5: da2991b37e3991230d79ba70f9c01682
35
- Bugs: https://bugs.launchpad.net/ubuntu/+filebug
36
- Origin: Ubuntu
37
- Supported: 9m
38
- Task: kubuntu-desktop, kubuntu-full, kubuntu-active, kubuntu-active-desktop, kubuntu-active-full, kubuntu-active, edubuntu-desktop-gnome, ubuntustudio-font-meta
39
- EOS
40
- expect(LinuxAdmin::Common).to receive(:run!)
41
- .with(described_class::APT_CACHE_CMD, :params => %w(show ruby))
42
- .and_return(double(:output => data))
43
- metadata = described_class.info("ruby")
44
- expect(metadata['package']).to eq('ruby')
45
- expect(metadata['priority']).to eq('optional')
46
- expect(metadata['section']).to eq('interpreters')
47
- expect(metadata['architecture']).to eq('all')
48
- expect(metadata['version']).to eq('4.9')
49
- expect(metadata['origin']).to eq('Ubuntu')
50
- end
51
- end
52
- end
@@ -1,246 +0,0 @@
1
- describe LinuxAdmin::Disk do
2
- describe "#local" do
3
- it "returns local disks" do
4
- expect(LinuxAdmin::Common).to receive(:run!).with(
5
- LinuxAdmin::Common.cmd(:lsblk),
6
- :params => {:d => nil, :n => nil, :p => nil, :o => "NAME"}
7
- ).and_return(double("result", :output => "/dev/hda\n/dev/sda"))
8
- disks = LinuxAdmin::Disk.local
9
- paths = disks.collect { |disk| disk.path }
10
- expect(paths).to include('/dev/hda')
11
- expect(paths).to include('/dev/sda')
12
- end
13
- end
14
-
15
- describe "#size" do
16
- it "uses fdisk" do
17
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
18
- expect(LinuxAdmin::Common).to receive(:run!)
19
- .with(LinuxAdmin::Common.cmd(:fdisk),
20
- :params => {"-l" => nil})
21
- .and_return(double(:output => ""))
22
- disk.size
23
- end
24
-
25
- it "returns disk size" do
26
- fdisk = <<eos
27
- Disk /dev/hda: 500.1 GB, 500107862016 bytes
28
- 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
29
- Units = sectors of 1 * 512 = 512 bytes
30
- Sector size (logical/physical): 512 bytes / 512 bytes
31
- I/O size (minimum/optimal): 512 bytes / 512 bytes
32
- Disk identifier: 0x3ddb508b
33
-
34
- Device Boot Start End Blocks Id System
35
- 1 1259MB 81.8GB 80.5GB primary ntfs
36
- 2 81.8GB 162GB 80.5GB primary ext4
37
- 3 162GB 163GB 1074MB logical linux-swap(v1)
38
- eos
39
-
40
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
41
- allow(LinuxAdmin::Common).to receive(:run!).and_return(double(:output => fdisk))
42
- expect(disk.size).to eq(500_107_862_016)
43
- end
44
- end
45
-
46
- describe "#partitions" do
47
- it "uses parted" do
48
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
49
- expect(LinuxAdmin::Common).to receive(:run)
50
- .with(LinuxAdmin::Common.cmd(:parted),
51
- :params => {nil => %w(--script /dev/hda print)}).and_return(double(:output => ""))
52
- disk.partitions
53
- end
54
-
55
- it "returns [] on non-zero parted rc" do
56
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
57
- expect(LinuxAdmin::Common).to receive(:run).and_return(double(:output => "", :exit_status => 1))
58
- expect(disk.partitions).to eq([])
59
- end
60
-
61
- it "sets partitons" do
62
- partitions = <<eos
63
- Model: ATA TOSHIBA MK5061GS (scsi)
64
- Disk /dev/sda: 500GB
65
- Sector size (logical/physical): 512B/512B
66
- Partition Table: msdos
67
- Disk Flags:
68
-
69
- Number Start End Size Type File system Flags
70
- 1 1259MB 81.8GB 80.5GB primary ntfs
71
- 2 81.8GB 162GB 80.5GB primary ext4
72
- 3 162GB 163GB 1074MB logical linux-swap(v1)
73
- eos
74
- disk = LinuxAdmin::Disk.new
75
- expect(LinuxAdmin::Common).to receive(:run).and_return(double(:output => partitions))
76
-
77
- expect(disk.partitions[0].id).to eq(1)
78
- expect(disk.partitions[0].disk).to eq(disk)
79
- expect(disk.partitions[0].size).to eq(86_436_216_832.0) # 80.5.gigabytes
80
- expect(disk.partitions[0].start_sector).to eq(1_320_157_184) # 1259.megabytes
81
- expect(disk.partitions[0].end_sector).to eq(87_832_081_203.2) # 81.8.gigabytes
82
- expect(disk.partitions[0].partition_type).to eq('primary')
83
- expect(disk.partitions[0].fs_type).to eq('ntfs')
84
- expect(disk.partitions[1].id).to eq(2)
85
- expect(disk.partitions[1].disk).to eq(disk)
86
- expect(disk.partitions[1].size).to eq(86_436_216_832.0) # 80.5.gigabytes
87
- expect(disk.partitions[1].start_sector).to eq(87_832_081_203.2) # 81.8.gigabytes
88
- expect(disk.partitions[1].end_sector).to eq(173_946_175_488) # 162.gigabytes
89
- expect(disk.partitions[1].partition_type).to eq('primary')
90
- expect(disk.partitions[1].fs_type).to eq('ext4')
91
- expect(disk.partitions[2].id).to eq(3)
92
- expect(disk.partitions[2].disk).to eq(disk)
93
- expect(disk.partitions[2].size).to eq(1_126_170_624) # 1074.megabytes
94
- expect(disk.partitions[2].start_sector).to eq(173_946_175_488) # 162.gigabytes
95
- expect(disk.partitions[2].end_sector).to eq(175_019_917_312) # 163.gigabytes
96
- expect(disk.partitions[2].partition_type).to eq('logical')
97
- expect(disk.partitions[2].fs_type).to eq('linux-swap(v1)')
98
- end
99
- end
100
-
101
- describe "#create_partitions" do
102
- before(:each) do
103
- @disk = LinuxAdmin::Disk.new(:path => '/dev/hda')
104
- end
105
-
106
- it "dispatches to create_partition" do
107
- expect(@disk).to receive(:create_partition).with("primary", "0%", "50%")
108
- @disk.create_partitions "primary", :start => "0%", :end => "50%"
109
- end
110
-
111
- context "multiple partitions specified" do
112
- it "calls create_partition for each partition" do
113
- expect(@disk).to receive(:create_partition).with("primary", "0%", "49%")
114
- expect(@disk).to receive(:create_partition).with("primary", "50%", "100%")
115
- @disk.create_partitions("primary", {:start => "0%", :end => "49%"},
116
- {:start => "50%", :end => "100%"})
117
- end
118
-
119
- context "partitions overlap" do
120
- it "raises argument error" do
121
- expect{
122
- @disk.create_partitions("primary", {:start => "0%", :end => "50%"},
123
- {:start => "49%", :end => "100%"})
124
- }.to raise_error(ArgumentError)
125
- end
126
- end
127
- end
128
- end
129
-
130
- describe "#create_partition" do
131
- before(:each) do
132
- # test disk w/ existing partition
133
- @disk = LinuxAdmin::Disk.new :path => '/dev/hda'
134
- @disk.instance_variable_set(:@partitions,
135
- [LinuxAdmin::Partition.new(:id => 1,
136
- :end_sector => 1024)])
137
- allow(@disk).to receive_messages(:has_partition_table? => true)
138
- end
139
-
140
- it "uses parted" do
141
- params = ['--script', '/dev/hda', 'mkpart', '-a', 'opt', 'primary', 1024, 2048]
142
- expect(LinuxAdmin::Common).to receive(:run!).with(LinuxAdmin::Common.cmd(:parted), :params => {nil => params})
143
- @disk.create_partition 'primary', 1024
144
- end
145
-
146
- it "accepts start/end params" do
147
- params = ['--script', '/dev/hda', 'mkpart', '-a', 'opt', 'primary', "0%", "50%"]
148
- expect(LinuxAdmin::Common).to receive(:run!).with(LinuxAdmin::Common.cmd(:parted), :params => {nil => params})
149
- @disk.create_partition 'primary', "0%", "50%"
150
- end
151
-
152
- context "missing params" do
153
- it "raises ArgumentError" do
154
- expect{
155
- @disk.create_partition 'primary'
156
- }.to raise_error(ArgumentError)
157
-
158
- expect{
159
- @disk.create_partition 'primary', '0%', '50%', 100
160
- }.to raise_error(ArgumentError)
161
- end
162
- end
163
-
164
- it "returns partition" do
165
- expect(LinuxAdmin::Common).to receive(:run!) # stub out call to parted
166
- partition = @disk.create_partition 'primary', 1024
167
- expect(partition).to be_an_instance_of(LinuxAdmin::Partition)
168
- end
169
-
170
- it "increments partition id" do
171
- expect(LinuxAdmin::Common).to receive(:run!) # stub out call to parted
172
- partition = @disk.create_partition 'primary', 1024
173
- expect(partition.id).to eq(2)
174
- end
175
-
176
- it "sets partition start to first unused sector on disk" do
177
- expect(LinuxAdmin::Common).to receive(:run!) # stub out call to parted
178
- partition = @disk.create_partition 'primary', 1024
179
- expect(partition.start_sector).to eq(1024)
180
- end
181
-
182
- it "stores new partition locally" do
183
- expect(LinuxAdmin::Common).to receive(:run!) # stub out call to parted
184
- expect {
185
- @disk.create_partition 'primary', 1024
186
- }.to change{@disk.partitions.size}.by(1)
187
- end
188
-
189
- it "creates partition table if missing" do
190
- allow(@disk).to receive_messages(:has_partition_table? => false)
191
- expect(@disk).to receive(:create_partition_table)
192
- expect(LinuxAdmin::Common).to receive(:run!)
193
- @disk.create_partition 'primary', 1024
194
- end
195
- end
196
-
197
- describe "#has_partition_table?" do
198
- it "positive case" do
199
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
200
- expect(LinuxAdmin::Common).to receive(:run).and_return(double(:output => "", :exit_status => 0))
201
- expect(disk).to have_partition_table
202
- end
203
-
204
- it "negative case" do
205
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
206
- output = "\e[?1034h\r\rError: /dev/sdb: unrecognised disk label\n"
207
- expect(LinuxAdmin::Common).to receive(:run).and_return(double(:output => output, :exit_status => 1))
208
- expect(disk).not_to have_partition_table
209
- end
210
- end
211
-
212
- it "#create_partition_table" do
213
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
214
- options = {:params => {nil => %w(--script /dev/hda mklabel msdos)}}
215
- expect(LinuxAdmin::Common).to receive(:run!).with(LinuxAdmin::Common.cmd(:parted), options)
216
- disk.create_partition_table
217
- end
218
-
219
- describe "#clear!" do
220
- it "clears partitions" do
221
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
222
- expect(LinuxAdmin::Common).to receive(:run).and_return(double(:output => "")) # stub out call to cmds
223
- disk.partitions << LinuxAdmin::Partition.new
224
-
225
- expect(LinuxAdmin::Common).to receive(:run!)
226
- disk.clear!
227
- expect(disk.partitions).to be_empty
228
- end
229
-
230
- it "uses dd to clear partition table" do
231
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
232
- expect(LinuxAdmin::Common).to receive(:run!)
233
- .with(LinuxAdmin::Common.cmd(:dd),
234
- :params => {'if=' => '/dev/zero', 'of=' => '/dev/hda',
235
- 'bs=' => 512, 'count=' => 1})
236
- disk.clear!
237
- end
238
-
239
- it "returns self" do
240
- disk = LinuxAdmin::Disk.new :path => '/dev/hda'
241
- allow(LinuxAdmin::Common).to receive(:run!) # stub out call to dd
242
- expect(disk.clear!).to eq(disk)
243
- end
244
- end
245
-
246
- end
@@ -1,77 +0,0 @@
1
- describe LinuxAdmin::Distros::Distro do
2
- let(:subject) { LinuxAdmin::Distros.local }
3
- describe "#local" do
4
- before do
5
- allow(LinuxAdmin::Distros).to receive(:local).and_call_original
6
- end
7
-
8
- [['ubuntu', :ubuntu],
9
- ['Fedora', :fedora],
10
- ['red hat', :rhel],
11
- ['CentOS', :rhel],
12
- ['centos', :rhel]].each do |i, d|
13
- context "/etc/issue contains '#{i}'" do
14
- before(:each) do
15
- etc_issue_contains(i)
16
- exists("/etc/fedora-release" => false, "/etc/redhat-release" => false)
17
- end
18
-
19
- it "returns Distros.#{d}" do
20
- distro = LinuxAdmin::Distros.send(d)
21
- expect(subject).to eq(distro)
22
- end
23
- end
24
- end
25
-
26
- context "/etc/issue did not match" do
27
- before(:each) do
28
- etc_issue_contains('')
29
- end
30
-
31
- context "/etc/redhat-release exists" do
32
- it "returns Distros.rhel" do
33
- exists("/etc/fedora-release" => false, "/etc/redhat-release" => true)
34
- expect(subject).to eq(LinuxAdmin::Distros.rhel)
35
- end
36
- end
37
-
38
- context "/etc/fedora-release exists" do
39
- it "returns Distros.fedora" do
40
- exists("/etc/fedora-release" => true, "/etc/redhat-release" => false)
41
- expect(subject).to eq(LinuxAdmin::Distros.fedora)
42
- end
43
- end
44
- end
45
-
46
- it "returns Distros.generic" do
47
- etc_issue_contains('')
48
- exists("/etc/fedora-release" => false, "/etc/redhat-release" => false)
49
- expect(subject).to eq(LinuxAdmin::Distros.generic)
50
- end
51
- end
52
-
53
- describe "#info" do
54
- it "dispatches to redhat lookup mechanism" do
55
- stub_distro(LinuxAdmin::Distros.rhel)
56
- expect(LinuxAdmin::Rpm).to receive(:info).with('ruby')
57
- LinuxAdmin::Distros.local.info 'ruby'
58
- end
59
-
60
- it "dispatches to ubuntu lookup mechanism" do
61
- stub_distro(LinuxAdmin::Distros.ubuntu)
62
- expect(LinuxAdmin::Deb).to receive(:info).with('ruby')
63
- LinuxAdmin::Distros.local.info 'ruby'
64
- end
65
-
66
- it "dispatches to ubuntu lookup mechanism" do
67
- stub_distro(LinuxAdmin::Distros.generic)
68
- expect { LinuxAdmin::Distros.local.info 'ruby' }.not_to raise_error
69
- end
70
- end
71
-
72
- private
73
-
74
- def exists(files)
75
- files.each_pair { |file, value| allow(File).to receive(:exist?).with(file).and_return(value) }
76
- end
77
- end