linux_admin 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,10 +22,10 @@ class LinuxAdmin
22
22
  private
23
23
 
24
24
  def self.registration_type_uncached
25
- if SubscriptionManager.new.registered?
26
- SubscriptionManager
27
- elsif Rhn.new.registered?
25
+ if Rhn.new.registered?
28
26
  Rhn
27
+ elsif SubscriptionManager.new.registered?
28
+ SubscriptionManager
29
29
  else
30
30
  self
31
31
  end
@@ -1,3 +1,3 @@
1
1
  class LinuxAdmin
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -9,7 +9,7 @@ class LinuxAdmin
9
9
 
10
10
  FileUtils.mkdir_p(path)
11
11
 
12
- cmd = "yum createrepo"
12
+ cmd = "createrepo"
13
13
  params = {nil => path}
14
14
  params["--database"] = nil if options[:database]
15
15
  params["--unique-md-filenames"] = nil if options[:unique_file_names]
@@ -8,7 +8,7 @@ describe LinuxAdmin::RegistrationSystem do
8
8
  end
9
9
 
10
10
  it "when registered RHN" do
11
- stub_registered_to_system(:rhn)
11
+ stub_registered_to_system(:sm, :rhn)
12
12
  expect(described_class.registration_type).to eq(LinuxAdmin::Rhn)
13
13
  end
14
14
 
@@ -53,8 +53,8 @@ describe LinuxAdmin::RegistrationSystem do
53
53
  end
54
54
  end
55
55
 
56
- def stub_registered_to_system(system)
57
- LinuxAdmin::SubscriptionManager.any_instance.stub(:registered? => (system == :sm))
58
- LinuxAdmin::Rhn.any_instance.stub(:registered? => data_file_path("rhn/systemid")) if system == :rhn
56
+ def stub_registered_to_system(*system)
57
+ LinuxAdmin::SubscriptionManager.any_instance.stub(:registered? => (system.include?(:sm)))
58
+ LinuxAdmin::Rhn.any_instance.stub(:registered? => (system.include?(:rhn)))
59
59
  end
60
60
  end
@@ -7,12 +7,12 @@ describe LinuxAdmin::Yum do
7
7
 
8
8
  context ".create_repo" do
9
9
  it "default arguments" do
10
- described_class.should_receive(:run!).once.with("yum createrepo", {:params=>{nil=>"some/path", "--database"=>nil, "--unique-md-filenames"=>nil}})
10
+ described_class.should_receive(:run!).once.with("createrepo", {:params=>{nil=>"some/path", "--database"=>nil, "--unique-md-filenames"=>nil}})
11
11
  described_class.create_repo("some/path")
12
12
  end
13
13
 
14
14
  it "bare create" do
15
- described_class.should_receive(:run!).once.with("yum createrepo", {:params=>{nil=>"some/path"}})
15
+ described_class.should_receive(:run!).once.with("createrepo", {:params=>{nil=>"some/path"}})
16
16
  described_class.create_repo("some/path", :database => false, :unique_file_names => false)
17
17
  end
18
18
  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.4.0
4
+ version: 0.4.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-10-02 00:00:00.000000000 Z
15
+ date: 2013-10-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler