linux_admin 0.14.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/lib/linux_admin/common.rb +4 -4
  3. data/lib/linux_admin/deb.rb +1 -1
  4. data/lib/linux_admin/disk.rb +6 -8
  5. data/lib/linux_admin/hosts.rb +4 -6
  6. data/lib/linux_admin/ip_address.rb +4 -6
  7. data/lib/linux_admin/logical_volume.rb +3 -3
  8. data/lib/linux_admin/mountable.rb +5 -8
  9. data/lib/linux_admin/network_interface.rb +4 -6
  10. data/lib/linux_admin/package.rb +0 -1
  11. data/lib/linux_admin/physical_volume.rb +3 -6
  12. data/lib/linux_admin/registration_system/rhn.rb +5 -5
  13. data/lib/linux_admin/registration_system/subscription_manager.rb +2 -2
  14. data/lib/linux_admin/registration_system.rb +1 -2
  15. data/lib/linux_admin/rpm.rb +7 -5
  16. data/lib/linux_admin/service/sys_v_init_service.rb +12 -12
  17. data/lib/linux_admin/service/systemd_service.rb +12 -12
  18. data/lib/linux_admin/service.rb +1 -3
  19. data/lib/linux_admin/system.rb +2 -4
  20. data/lib/linux_admin/time_date.rb +3 -4
  21. data/lib/linux_admin/version.rb +1 -1
  22. data/lib/linux_admin/volume.rb +1 -1
  23. data/lib/linux_admin/volume_group.rb +7 -10
  24. data/lib/linux_admin/yum.rb +6 -8
  25. data/lib/linux_admin.rb +0 -2
  26. data/spec/common_spec.rb +6 -8
  27. data/spec/deb_spec.rb +3 -3
  28. data/spec/disk_spec.rb +27 -27
  29. data/spec/hosts_spec.rb +5 -5
  30. data/spec/ip_address_spec.rb +4 -4
  31. data/spec/logical_volume_spec.rb +38 -38
  32. data/spec/mountable_spec.rb +22 -20
  33. data/spec/network_interface/network_interface_rh_spec.rb +13 -9
  34. data/spec/network_interface_spec.rb +4 -6
  35. data/spec/partition_spec.rb +1 -1
  36. data/spec/physical_volume_spec.rb +16 -20
  37. data/spec/rhn_spec.rb +22 -9
  38. data/spec/rpm_spec.rb +6 -4
  39. data/spec/service/sys_v_init_service_spec.rb +27 -28
  40. data/spec/service/systemd_service_spec.rb +20 -20
  41. data/spec/service_spec.rb +1 -1
  42. data/spec/subscription_manager_spec.rb +27 -15
  43. data/spec/system_spec.rb +2 -6
  44. data/spec/time_date_spec.rb +1 -1
  45. data/spec/volume_group_spec.rb +15 -19
  46. data/spec/yum_spec.rb +27 -15
  47. metadata +8 -6
data/spec/service_spec.rb CHANGED
@@ -49,6 +49,6 @@ describe LinuxAdmin::Service do
49
49
  end
50
50
 
51
51
  def stub_to_service_type(system)
52
- allow(LinuxAdmin::Service).to receive(:cmd?).with(:systemctl).and_return(system == :systemd_service)
52
+ allow(LinuxAdmin::Common).to receive(:cmd?).with(:systemctl).and_return(system == :systemd_service)
53
53
  end
54
54
  end
@@ -1,18 +1,20 @@
1
1
  describe LinuxAdmin::SubscriptionManager do
2
2
  context "#registered?" do
3
3
  it "system with subscription-manager commands" do
4
- expect_any_instance_of(described_class).to receive(:run).once.with("subscription-manager identity").and_return(double(:exit_status => 0))
4
+ expect(LinuxAdmin::Common).to receive(:run).once.with("subscription-manager identity")
5
+ .and_return(double(:exit_status => 0))
5
6
  expect(described_class.new.registered?).to be_truthy
6
7
  end
7
8
 
8
9
  it "system without subscription-manager commands" do
9
- expect_any_instance_of(described_class).to receive(:run).once.with("subscription-manager identity").and_return(double(:exit_status => 255))
10
+ expect(LinuxAdmin::Common).to receive(:run).once.with("subscription-manager identity")
11
+ .and_return(double(:exit_status => 255))
10
12
  expect(described_class.new.registered?).to be_falsey
11
13
  end
12
14
  end
13
15
 
14
16
  it "#refresh" do
15
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager refresh")
17
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager refresh", {})
16
18
  described_class.new.refresh
17
19
  end
18
20
 
@@ -37,14 +39,14 @@ describe LinuxAdmin::SubscriptionManager do
37
39
  run_params.store_path(:params, "--org=", "IT")
38
40
  base_options.store_path(:server_url, "https://server.url")
39
41
 
40
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager register", run_params)
42
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager register", run_params)
41
43
  expect(LinuxAdmin::Rpm).to receive(:upgrade).with("http://server.url/pub/katello-ca-consumer-latest.noarch.rpm")
42
44
 
43
45
  described_class.new.register(base_options)
44
46
  end
45
47
 
46
48
  it "without server_url" do
47
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager register", run_params)
49
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager register", run_params)
48
50
  expect_any_instance_of(described_class).not_to receive(:install_server_certificate)
49
51
 
50
52
  described_class.new.register(base_options)
@@ -54,30 +56,35 @@ describe LinuxAdmin::SubscriptionManager do
54
56
 
55
57
  context "#subscribe" do
56
58
  it "with pools" do
57
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager attach", {:params=>[["--pool", 123], ["--pool", 456]]})
59
+ expect(LinuxAdmin::Common).to receive(:run!).once
60
+ .with("subscription-manager attach", :params => [["--pool", 123], ["--pool", 456]])
58
61
  described_class.new.subscribe({:pools => [123, 456]})
59
62
  end
60
63
 
61
64
  it "without pools" do
62
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager attach", {:params=>{"--auto"=>nil}})
65
+ expect(LinuxAdmin::Common).to receive(:run!).once
66
+ .with("subscription-manager attach", :params => {"--auto" => nil})
63
67
  described_class.new.subscribe({})
64
68
  end
65
69
  end
66
70
 
67
71
  context "#subscribed_products" do
68
72
  it "subscribed" do
69
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager list --installed").and_return(double(:output => sample_output("subscription_manager/output_list_installed_subscribed")))
73
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager list --installed", {})
74
+ .and_return(double(:output => sample_output("subscription_manager/output_list_installed_subscribed")))
70
75
  expect(described_class.new.subscribed_products).to eq(["69", "167"])
71
76
  end
72
77
 
73
78
  it "not subscribed" do
74
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager list --installed").and_return(double(:output => sample_output("subscription_manager/output_list_installed_not_subscribed")))
79
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager list --installed", {})
80
+ .and_return(double(:output => sample_output("subscription_manager/output_list_installed_not_subscribed")))
75
81
  expect(described_class.new.subscribed_products).to eq(["167"])
76
82
  end
77
83
  end
78
84
 
79
85
  it "#available_subscriptions" do
80
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager list --all --available").and_return(double(:output => sample_output("subscription_manager/output_list_all_available")))
86
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager list --all --available", {})
87
+ .and_return(double(:output => sample_output("subscription_manager/output_list_all_available")))
81
88
  expect(described_class.new.available_subscriptions).to eq({
82
89
  "82c042fca983889b10178893f29b06e3" => {
83
90
  :subscription_name => "Example Subscription",
@@ -131,7 +138,8 @@ describe LinuxAdmin::SubscriptionManager do
131
138
  run_options = ["subscription-manager orgs", {:params=>{"--username="=>"SomeUser", "--password="=>"SomePass", "--proxy="=>"1.2.3.4", "--proxyuser="=>"ProxyUser", "--proxypassword="=>"ProxyPass"}}]
132
139
 
133
140
  expect(LinuxAdmin::Rpm).to receive(:upgrade).with("http://192.168.1.1/pub/katello-ca-consumer-latest.noarch.rpm")
134
- expect_any_instance_of(described_class).to receive(:run!).once.with(*run_options).and_return(double(:output => sample_output("subscription_manager/output_orgs")))
141
+ expect(LinuxAdmin::Common).to receive(:run!).once.with(*run_options)
142
+ .and_return(double(:output => sample_output("subscription_manager/output_orgs")))
135
143
 
136
144
  expect(described_class.new.organizations({:username=>"SomeUser", :password=>"SomePass", :proxy_address=>"1.2.3.4", :proxy_username=>"ProxyUser", :proxy_password=>"ProxyPass", :server_url=>"192.168.1.1"})).to eq({"SomeOrg"=>{:name=>"SomeOrg", :key=>"1234567"}})
137
145
  end
@@ -150,13 +158,15 @@ describe LinuxAdmin::SubscriptionManager do
150
158
  end
151
159
 
152
160
  it "#enable_repo" do
153
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager repos", {:params=>{"--enable="=>"abc"}})
161
+ expect(LinuxAdmin::Common).to receive(:run!).once
162
+ .with("subscription-manager repos", :params => {"--enable=" => "abc"})
154
163
 
155
164
  described_class.new.enable_repo("abc")
156
165
  end
157
166
 
158
167
  it "#disable_repo" do
159
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager repos", {:params=>{"--disable="=>"abc"}})
168
+ expect(LinuxAdmin::Common).to receive(:run!).once
169
+ .with("subscription-manager repos", :params => {"--disable=" => "abc"})
160
170
 
161
171
  described_class.new.disable_repo("abc")
162
172
  end
@@ -183,7 +193,8 @@ describe LinuxAdmin::SubscriptionManager do
183
193
  }
184
194
  ]
185
195
 
186
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager repos").and_return(double(:output => sample_output("subscription_manager/output_repos")))
196
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager repos", {})
197
+ .and_return(double(:output => sample_output("subscription_manager/output_repos")))
187
198
 
188
199
  expect(described_class.new.all_repos).to eq(expected)
189
200
  end
@@ -191,7 +202,8 @@ describe LinuxAdmin::SubscriptionManager do
191
202
  it "#enabled_repos" do
192
203
  expected = ["some-repo-source-rpms", "some-repo-rpms"]
193
204
 
194
- expect_any_instance_of(described_class).to receive(:run!).once.with("subscription-manager repos").and_return(double(:output => sample_output("subscription_manager/output_repos")))
205
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("subscription-manager repos", {})
206
+ .and_return(double(:output => sample_output("subscription_manager/output_repos")))
195
207
 
196
208
  expect(described_class.new.enabled_repos).to eq(expected)
197
209
  end
data/spec/system_spec.rb CHANGED
@@ -1,18 +1,14 @@
1
1
  describe LinuxAdmin::System do
2
2
  describe "#reboot!" do
3
3
  it "reboots the system" do
4
- expect(LinuxAdmin::System).to receive(:run!).
5
- with(LinuxAdmin::System.cmd(:shutdown),
6
- :params => { '-r' => 'now'})
4
+ expect(LinuxAdmin::Common).to receive(:run!).with(LinuxAdmin::Common.cmd(:shutdown), :params => {'-r' => 'now'})
7
5
  LinuxAdmin::System.reboot!
8
6
  end
9
7
  end
10
8
 
11
9
  describe "#shutdown!" do
12
10
  it "shuts down the system" do
13
- expect(LinuxAdmin::System).to receive(:run!).
14
- with(LinuxAdmin::System.cmd(:shutdown),
15
- :params => { '-h' => '0'})
11
+ expect(LinuxAdmin::Common).to receive(:run!).with(LinuxAdmin::Common.cmd(:shutdown), :params => {'-h' => '0'})
16
12
  LinuxAdmin::System.shutdown!
17
13
  end
18
14
  end
@@ -1,5 +1,5 @@
1
1
  describe LinuxAdmin::TimeDate do
2
- RUN_COMMAND = described_class.cmd("timedatectl")
2
+ RUN_COMMAND = LinuxAdmin::Common.cmd("timedatectl")
3
3
 
4
4
  def timedatectl_result
5
5
  output = File.read(Pathname.new(data_file_path("time_date/timedatectl_output")))
@@ -16,16 +16,15 @@ eos
16
16
  it "uses lvextend" do
17
17
  vg = described_class.new :name => 'vg'
18
18
  lv = LinuxAdmin::LogicalVolume.new :name => 'lv', :volume_group => vg
19
- expect(vg).to receive(:run!).
20
- with(vg.cmd(:lvextend),
21
- :params => ['lv', 'vg'])
19
+ expect(LinuxAdmin::Common).to receive(:run!)
20
+ .with(LinuxAdmin::Common.cmd(:lvextend), :params => %w(lv vg))
22
21
  vg.attach_to(lv)
23
22
  end
24
23
 
25
24
  it "returns self" do
26
25
  vg = described_class.new :name => 'vg'
27
26
  lv = LinuxAdmin::LogicalVolume.new :name => 'lv', :volume_group => vg
28
- allow(vg).to receive(:run!)
27
+ allow(LinuxAdmin::Common).to receive(:run!)
29
28
  expect(vg.attach_to(lv)).to eq(vg)
30
29
  end
31
30
  end
@@ -34,16 +33,15 @@ eos
34
33
  it "uses vgextend" do
35
34
  vg = described_class.new :name => 'vg'
36
35
  pv = LinuxAdmin::PhysicalVolume.new :device_name => '/dev/hda'
37
- expect(vg).to receive(:run!).
38
- with(vg.cmd(:vgextend),
39
- :params => ['vg', '/dev/hda'])
36
+ expect(LinuxAdmin::Common).to receive(:run!)
37
+ .with(LinuxAdmin::Common.cmd(:vgextend), :params => ['vg', '/dev/hda'])
40
38
  vg.extend_with(pv)
41
39
  end
42
40
 
43
41
  it "assigns volume group to physical volume" do
44
42
  vg = described_class.new :name => 'vg'
45
43
  pv = LinuxAdmin::PhysicalVolume.new :device_name => '/dev/hda'
46
- allow(vg).to receive(:run!)
44
+ allow(LinuxAdmin::Common).to receive(:run!)
47
45
  vg.extend_with(pv)
48
46
  expect(pv.volume_group).to eq(vg)
49
47
  end
@@ -51,7 +49,7 @@ eos
51
49
  it "returns self" do
52
50
  vg = described_class.new :name => 'vg'
53
51
  pv = LinuxAdmin::PhysicalVolume.new :device_name => '/dev/hda'
54
- allow(vg).to receive(:run!)
52
+ allow(LinuxAdmin::Common).to receive(:run!)
55
53
  expect(vg.extend_with(pv)).to eq(vg)
56
54
  end
57
55
  end
@@ -63,21 +61,20 @@ eos
63
61
 
64
62
  it "uses vgcreate" do
65
63
  described_class.instance_variable_set(:@vgs, [])
66
- expect(described_class).to receive(:run!).
67
- with(LinuxAdmin.cmd(:vgcreate),
68
- :params => ['vg', '/dev/hda'])
64
+ expect(LinuxAdmin::Common).to receive(:run!)
65
+ .with(LinuxAdmin::Common.cmd(:vgcreate), :params => ['vg', '/dev/hda'])
69
66
  described_class.create 'vg', @pv
70
67
  end
71
68
 
72
69
  it "returns new volume group" do
73
- allow(described_class).to receive_messages(:run! => double(:output => ""))
70
+ allow(LinuxAdmin::Common).to receive_messages(:run! => double(:output => ""))
74
71
  vg = described_class.create 'vg', @pv
75
72
  expect(vg).to be_an_instance_of(described_class)
76
73
  expect(vg.name).to eq('vg')
77
74
  end
78
75
 
79
76
  it "adds volume group to local registry" do
80
- allow(described_class).to receive_messages(:run! => double(:output => ""))
77
+ allow(LinuxAdmin::Common).to receive_messages(:run! => double(:output => ""))
81
78
  vg = described_class.create 'vg', @pv
82
79
  expect(described_class.scan).to include(vg)
83
80
  end
@@ -85,15 +82,14 @@ eos
85
82
 
86
83
  describe "#scan" do
87
84
  it "uses vgdisplay" do
88
- expect(described_class).to receive(:run!).
89
- with(LinuxAdmin.cmd(:vgdisplay),
90
- :params => { '-c' => nil}).
91
- and_return(double(:output => @groups))
85
+ expect(LinuxAdmin::Common).to receive(:run!)
86
+ .with(LinuxAdmin::Common.cmd(:vgdisplay), :params => {'-c' => nil})
87
+ .and_return(double(:output => @groups))
92
88
  described_class.scan
93
89
  end
94
90
 
95
91
  it "returns local volume groups" do
96
- expect(described_class).to receive(:run!).and_return(double(:output => @groups))
92
+ expect(LinuxAdmin::Common).to receive(:run!).and_return(double(:output => @groups))
97
93
  vgs = described_class.scan
98
94
 
99
95
  expect(vgs[0]).to be_an_instance_of(described_class)
data/spec/yum_spec.rb CHANGED
@@ -5,19 +5,21 @@ describe LinuxAdmin::Yum do
5
5
 
6
6
  context ".create_repo" do
7
7
  it "default arguments" do
8
- expect(described_class).to receive(:run!).once.with("createrepo", {:params=>{nil=>"some/path", "--database"=>nil, "--unique-md-filenames"=>nil}})
8
+ expect(LinuxAdmin::Common).to receive(:run!).once
9
+ .with("createrepo", :params => {nil => "some/path", "--database" => nil, "--unique-md-filenames" => nil})
9
10
  described_class.create_repo("some/path")
10
11
  end
11
12
 
12
13
  it "bare create" do
13
- expect(described_class).to receive(:run!).once.with("createrepo", {:params=>{nil=>"some/path"}})
14
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("createrepo", :params => {nil => "some/path"})
14
15
  described_class.create_repo("some/path", :database => false, :unique_file_names => false)
15
16
  end
16
17
  end
17
18
 
18
19
  context ".download_packages" do
19
20
  it "with valid input" do
20
- expect(described_class).to receive(:run!).once.with("repotrack", {:params=>{"-p"=>"some/path", nil=>"pkg_a pkg_b"}})
21
+ expect(LinuxAdmin::Common).to receive(:run!).once
22
+ .with("repotrack", :params => {"-p" => "some/path", nil => "pkg_a pkg_b"})
21
23
  described_class.download_packages("some/path", "pkg_a pkg_b")
22
24
  end
23
25
 
@@ -66,45 +68,49 @@ describe LinuxAdmin::Yum do
66
68
 
67
69
  context ".updates_available?" do
68
70
  it "check updates for a specific package" do
69
- expect(described_class).to receive(:run).once.with("yum check-update", {:params=>{nil=>["abc"]}}).and_return(double(:exit_status => 100))
71
+ expect(LinuxAdmin::Common).to receive(:run).once.with("yum check-update", :params => {nil => ["abc"]})
72
+ .and_return(double(:exit_status => 100))
70
73
  expect(described_class.updates_available?("abc")).to be_truthy
71
74
  end
72
75
 
73
76
  it "updates are available" do
74
- allow(described_class).to receive_messages(:run => double(:exit_status => 100))
77
+ allow(LinuxAdmin::Common).to receive_messages(:run => double(:exit_status => 100))
75
78
  expect(described_class.updates_available?).to be_truthy
76
79
  end
77
80
 
78
81
  it "updates not available" do
79
- allow(described_class).to receive_messages(:run => double(:exit_status => 0))
82
+ allow(LinuxAdmin::Common).to receive_messages(:run => double(:exit_status => 0))
80
83
  expect(described_class.updates_available?).to be_falsey
81
84
  end
82
85
 
83
86
  it "other exit code" do
84
- allow(described_class).to receive_messages(:run => double(:exit_status => 255))
87
+ allow(LinuxAdmin::Common).to receive_messages(:run => double(:exit_status => 255))
85
88
  expect { described_class.updates_available? }.to raise_error(RuntimeError)
86
89
  end
87
90
 
88
91
  it "other error" do
89
- allow(described_class).to receive(:run).and_raise(RuntimeError)
92
+ allow(LinuxAdmin::Common).to receive(:run).and_raise(RuntimeError)
90
93
  expect { described_class.updates_available? }.to raise_error(RuntimeError)
91
94
  end
92
95
  end
93
96
 
94
97
  context ".update" do
95
98
  it "no arguments" do
96
- expect(described_class).to receive(:run!).once.with("yum -y update", :params => nil).and_return(AwesomeSpawn::CommandResult.new("", "", "", 0))
99
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("yum -y update", :params => nil)
100
+ .and_return(AwesomeSpawn::CommandResult.new("", "", "", 0))
97
101
  described_class.update
98
102
  end
99
103
 
100
104
  it "with arguments" do
101
- expect(described_class).to receive(:run!).once.with("yum -y update", :params => {nil => ["1 2", "3"]}).and_return(AwesomeSpawn::CommandResult.new("", "", "", 0))
105
+ expect(LinuxAdmin::Common).to receive(:run!).once.with("yum -y update", :params => {nil => ["1 2", "3"]})
106
+ .and_return(AwesomeSpawn::CommandResult.new("", "", "", 0))
102
107
  described_class.update("1 2", "3")
103
108
  end
104
109
 
105
110
  it "with bad arguments" do
106
111
  error = AwesomeSpawn::CommandResult.new("", "Loaded plugins: product-id\nNo Packages marked for Update\n", "Blah blah ...\nNo Match for argument: \n", 0)
107
- expect(described_class).to receive(:run!).once.with("yum -y update", :params => {nil => [""]}).and_return(error)
112
+ expect(LinuxAdmin::Common).to receive(:run!).once
113
+ .with("yum -y update", :params => {nil => [""]}).and_return(error)
108
114
  expect { described_class.update("") }.to raise_error(AwesomeSpawn::CommandResultError)
109
115
  end
110
116
  end
@@ -115,12 +121,16 @@ describe LinuxAdmin::Yum do
115
121
  end
116
122
 
117
123
  it "with one package" do
118
- expect(described_class).to receive(:run!).once.with("repoquery --qf=\"%{name} %{version}\"", {:params=>{nil=>["subscription-manager"]}}).and_return(double(:output => sample_output("yum/output_repoquery_single")))
124
+ expect(LinuxAdmin::Common).to receive(:run!).once
125
+ .with("repoquery --qf=\"%{name} %{version}\"", :params => {nil => ["subscription-manager"]})
126
+ .and_return(double(:output => sample_output("yum/output_repoquery_single")))
119
127
  expect(described_class.version_available("subscription-manager")).to eq({"subscription-manager" => "1.1.23.1"})
120
128
  end
121
129
 
122
130
  it "with multiple packages" do
123
- expect(described_class).to receive(:run!).once.with("repoquery --qf=\"%{name} %{version}\"", {:params=>{nil=>["curl", "subscription-manager", "wget"]}}).and_return(double(:output => sample_output("yum/output_repoquery_multiple")))
131
+ expect(LinuxAdmin::Common).to receive(:run!).once
132
+ .with("repoquery --qf=\"%{name} %{version}\"", :params => {nil => ["curl", "subscription-manager", "wget"]})
133
+ .and_return(double(:output => sample_output("yum/output_repoquery_multiple")))
124
134
  expect(described_class.version_available("curl", "subscription-manager", "wget")).to eq({
125
135
  "curl" => "7.19.7",
126
136
  "subscription-manager" => "1.1.23.1",
@@ -131,12 +141,14 @@ describe LinuxAdmin::Yum do
131
141
 
132
142
  context ".repo_list" do
133
143
  it "with no arguments" do
134
- expect(described_class).to receive(:run!).with("yum repolist", {:params=>{nil=>"enabled"}}).and_return(double(:output => sample_output("yum/output_repo_list")))
144
+ expect(LinuxAdmin::Common).to receive(:run!).with("yum repolist", :params => {nil => "enabled"})
145
+ .and_return(double(:output => sample_output("yum/output_repo_list")))
135
146
  expect(described_class.repo_list).to eq(["rhel-6-server-rpms", "rhel-ha-for-rhel-6-server-rpms", "rhel-lb-for-rhel-6-server-rpms"])
136
147
  end
137
148
 
138
149
  it "with argument" do
139
- expect(described_class).to receive(:run!).with("yum repolist", {:params=>{nil=>"enabled"}}).and_return(double(:output => sample_output("yum/output_repo_list")))
150
+ expect(LinuxAdmin::Common).to receive(:run!).with("yum repolist", :params => {nil => "enabled"})
151
+ .and_return(double(:output => sample_output("yum/output_repo_list")))
140
152
  expect(described_class.repo_list("enabled")).to eq(["rhel-6-server-rpms", "rhel-ha-for-rhel-6-server-rpms", "rhel-lb-for-rhel-6-server-rpms"])
141
153
  end
142
154
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linux_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Dunne
@@ -11,10 +11,11 @@ authors:
11
11
  - Keenan Brock
12
12
  - Thomas Wiest
13
13
  - Nick Carboni
14
+ - Martin Hradil
14
15
  autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
- date: 2016-01-15 00:00:00.000000000 Z
18
+ date: 2016-02-11 00:00:00.000000000 Z
18
19
  dependencies:
19
20
  - !ruby/object:Gem::Dependency
20
21
  name: bundler
@@ -106,14 +107,14 @@ dependencies:
106
107
  requirements:
107
108
  - - "~>"
108
109
  - !ruby/object:Gem::Version
109
- version: '1.1'
110
+ version: '2.0'
110
111
  type: :runtime
111
112
  prerelease: false
112
113
  version_requirements: !ruby/object:Gem::Requirement
113
114
  requirements:
114
115
  - - "~>"
115
116
  - !ruby/object:Gem::Version
116
- version: '1.1'
117
+ version: '2.0'
117
118
  - !ruby/object:Gem::Dependency
118
119
  name: awesome_spawn
119
120
  requirement: !ruby/object:Gem::Requirement
@@ -166,9 +167,10 @@ email:
166
167
  - fryguy9@gmail.com
167
168
  - mmorsi@redhat.com
168
169
  - jrafanie@redhat.com
169
- - kbrock@redhat.com
170
+ - keenan@thebrocks.net
170
171
  - twiest@redhat.com
171
172
  - ncarboni@redhat.com
173
+ - mhradil@redhat.com
172
174
  executables: []
173
175
  extensions: []
174
176
  extra_rdoc_files: []
@@ -282,7 +284,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
284
  version: '0'
283
285
  requirements: []
284
286
  rubyforge_project:
285
- rubygems_version: 2.4.5
287
+ rubygems_version: 2.4.5.1
286
288
  signing_key:
287
289
  specification_version: 4
288
290
  summary: LinuxAdmin is a module to simplify management of linux systems.