simp-metadata 0.4.4 → 0.5.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 +5 -5
  2. data/README.md +494 -0
  3. data/Rakefile +19 -22
  4. data/exe/simp-install +1 -1
  5. data/exe/simp-media +1 -1
  6. data/exe/simp-metadata +1 -1
  7. data/lib/simp/install/command.rb +34 -35
  8. data/lib/simp/media.rb +0 -1
  9. data/lib/simp/media/command.rb +34 -35
  10. data/lib/simp/media/engine.rb +29 -35
  11. data/lib/simp/media/type.rb +1 -2
  12. data/lib/simp/media/type/base.rb +12 -4
  13. data/lib/simp/media/type/control-repo.rb +96 -107
  14. data/lib/simp/media/type/internet.rb +8 -8
  15. data/lib/simp/media/type/iso.rb +0 -1
  16. data/lib/simp/media/type/local.rb +18 -19
  17. data/lib/simp/media/type/tar.rb +37 -37
  18. data/lib/simp/metadata.rb +240 -258
  19. data/lib/simp/metadata/bootstrap_source.rb +93 -89
  20. data/lib/simp/metadata/buildinfo.rb +23 -23
  21. data/lib/simp/metadata/command.rb +60 -58
  22. data/lib/simp/metadata/commands.rb +1 -1
  23. data/lib/simp/metadata/commands/base.rb +28 -25
  24. data/lib/simp/metadata/commands/clone.rb +3 -5
  25. data/lib/simp/metadata/commands/component.rb +128 -90
  26. data/lib/simp/metadata/commands/delete.rb +4 -5
  27. data/lib/simp/metadata/commands/pry.rb +1 -3
  28. data/lib/simp/metadata/commands/release.rb +22 -23
  29. data/lib/simp/metadata/commands/releases.rb +1 -3
  30. data/lib/simp/metadata/commands/save.rb +10 -13
  31. data/lib/simp/metadata/commands/script.rb +11 -14
  32. data/lib/simp/metadata/commands/search.rb +15 -20
  33. data/lib/simp/metadata/commands/set-write-url.rb +1 -3
  34. data/lib/simp/metadata/commands/set-write.rb +1 -3
  35. data/lib/simp/metadata/commands/update.rb +9 -10
  36. data/lib/simp/metadata/component.rb +310 -154
  37. data/lib/simp/metadata/components.rb +15 -16
  38. data/lib/simp/metadata/engine.rb +31 -39
  39. data/lib/simp/metadata/fake_uri.rb +2 -0
  40. data/lib/simp/metadata/location.rb +99 -105
  41. data/lib/simp/metadata/locations.rb +19 -21
  42. data/lib/simp/metadata/release.rb +30 -39
  43. data/lib/simp/metadata/releases.rb +14 -15
  44. data/lib/simp/metadata/source.rb +69 -79
  45. data/lib/simp/metadata/version.rb +9 -0
  46. data/spec/simp/media/command_spec.rb +4 -5
  47. data/spec/simp/media/engine_spec.rb +14 -14
  48. data/spec/simp/media/type/control_repo_spec.rb +10 -12
  49. data/spec/simp/media/type/internet_spec.rb +11 -11
  50. data/spec/simp/media/type/iso_spec.rb +6 -7
  51. data/spec/simp/media/type/local_spec.rb +6 -8
  52. data/spec/simp/media/type/tar_spec.rb +6 -8
  53. data/spec/simp/metadata/buildinfo_spec.rb +19 -17
  54. data/spec/simp/metadata/commands/clone_spec.rb +4 -3
  55. data/spec/simp/metadata/component_spec.rb +43 -54
  56. data/spec/simp/metadata/engine_spec.rb +38 -41
  57. data/spec/simp/metadata/release_spec.rb +72 -79
  58. data/spec/simp/metadata/source_spec.rb +8 -6
  59. data/spec/simp/metadata_spec.rb +95 -98
  60. data/spec/spec_helper.rb +33 -21
  61. metadata +5 -3
@@ -0,0 +1,9 @@
1
+ module Simp
2
+ module Metadata
3
+ class Version
4
+ def self.version
5
+ '0.5.2'.freeze
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,12 +1,11 @@
1
- require 'spec_helper'
1
+ require_relative '../../spec_helper'
2
2
  require 'simp/media'
3
3
  require 'simp/media/command'
4
4
 
5
5
  describe Simp::Media::Command do
6
- xit "Should display help when no options are passed" do
6
+ xit 'Should display help when no options are passed' do
7
7
  # Create an output capture system.
8
- command = Simp::Media::Command.new()
8
+ command = Simp::Media::Command.new
9
9
  command.run([])
10
10
  end
11
-
12
- end
11
+ end
@@ -1,28 +1,28 @@
1
- require 'spec_helper'
1
+ require_relative '../../spec_helper'
2
2
  require 'simp/media'
3
3
 
4
4
  describe Simp::Media::Engine do
5
- it "should throw an error if input_type is nil" do
6
- expect { engine = Simp::Media::Engine.new({"version" => "test-stub", "input_type" => nil}) }.to raise_error(RuntimeError, "input_type must be specified")
5
+ it 'should throw an error if input_type is nil' do
6
+ expect { engine = Simp::Media::Engine.new('version' => 'test-stub', 'input_type' => nil) }.to raise_error(RuntimeError, 'input_type must be specified')
7
7
  end
8
- it "should throw an error if output_type is nil" do
9
- expect { engine = Simp::Media::Engine.new({"version" => "test-stub", "output_type" => nil}) }.to raise_error(RuntimeError, "output_type must be specified")
8
+ it 'should throw an error if output_type is nil' do
9
+ expect { engine = Simp::Media::Engine.new('version' => 'test-stub', 'output_type' => nil) }.to raise_error(RuntimeError, 'output_type must be specified')
10
10
  end
11
- it "should instantiate without errors" do
12
- tempdir = Dir.mktmpdir("simp-media-rspec")
13
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "community", "output_type" => "tar", "output" => "#{tempdir}/test.tgz"})
11
+ it 'should instantiate without errors' do
12
+ tempdir = Dir.mktmpdir('simp-media-rspec')
13
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'community', 'output_type' => 'tar', 'output' => "#{tempdir}/test.tgz")
14
14
  expect(engine.loaded?).to match(true)
15
- engine.cleanup()
15
+ engine.cleanup
16
16
  engine = nil
17
17
  FileUtils.rmtree(tempdir)
18
18
  end
19
- it "should run without errors" do
20
- tempdir = Dir.mktmpdir("simp-media-rspec")
21
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "community", "output_type" => "tar", "output" => "#{tempdir}/test.tgz"})
19
+ it 'should run without errors' do
20
+ tempdir = Dir.mktmpdir('simp-media-rspec')
21
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'community', 'output_type' => 'tar', 'output' => "#{tempdir}/test.tgz")
22
22
  expect(engine.loaded?).to match(true)
23
23
  engine.run
24
- engine.cleanup()
24
+ engine.cleanup
25
25
  engine = nil
26
26
  FileUtils.rmtree(tempdir)
27
27
  end
28
- end
28
+ end
@@ -1,23 +1,21 @@
1
- require 'spec_helper'
1
+ require_relative '../../../spec_helper'
2
2
  require 'simp/media'
3
3
 
4
4
  describe Simp::Media::Type::Control_repo do
5
-
6
- it "should throw an error if output is nil" do
7
- expect { engine = Simp::Media::Engine.new({"version" => "test-stub", "output" => nil}) }.to raise_error(RuntimeError, "output must be specified for control-repo output")
5
+ it 'should throw an error if output is nil' do
6
+ expect { engine = Simp::Media::Engine.new('version' => 'test-stub', 'output' => nil) }.to raise_error(RuntimeError, 'output must be specified for control-repo output')
8
7
  end
9
8
  it "should throw an error if output is not a git repo and it's not a local directory" do
10
- expect { engine = Simp::Media::Engine.new({"version" => "test-stub", "output" => "https://localhost:6666/repo.git"}) }.to raise_error(RuntimeError, "output is not a valid control-repo")
9
+ expect { engine = Simp::Media::Engine.new('version' => 'test-stub', 'output' => 'https://localhost:6666/repo.git') }.to raise_error(RuntimeError, 'output is not a valid control-repo')
11
10
  end
12
11
 
13
- it "should create a bare repo when .git is part of the path" do
14
- tempdir = Dir.mktmpdir("simp-media-rspec")
15
- engine = Simp::Media::Engine.new({"version" => "test-stub", "output" => "file://#{tempdir}/control-repo.git"})
12
+ it 'should create a bare repo when .git is part of the path' do
13
+ tempdir = Dir.mktmpdir('simp-media-rspec')
14
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'output' => "file://#{tempdir}/control-repo.git")
16
15
  expect(engine.loaded?).to match(true)
17
- engine.run()
18
- engine.cleanup()
16
+ engine.run
17
+ engine.cleanup
19
18
  engine = nil
20
19
  FileUtils.rmtree(tempdir)
21
20
  end
22
-
23
- end
21
+ end
@@ -1,29 +1,29 @@
1
- require 'spec_helper'
1
+ require_relative '../../../spec_helper'
2
2
  require 'simp/media'
3
3
 
4
4
  describe Simp::Media::Type::Internet do
5
5
  describe "with edition == 'community'" do
6
- it "should run without errors" do
7
- tempdir = Dir.mktmpdir("simp-media-rspec")
8
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "community", "output_type" => "tar", "output" => "#{tempdir}/test.tgz"})
6
+ it 'should run without errors' do
7
+ tempdir = Dir.mktmpdir('simp-media-rspec')
8
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'community', 'output_type' => 'tar', 'output' => "#{tempdir}/test.tgz")
9
9
  expect(engine.loaded?).to match(true)
10
10
  engine.run
11
- engine.cleanup()
11
+ engine.cleanup
12
12
  engine = nil
13
13
  FileUtils.rmtree(tempdir)
14
14
  end
15
15
  end
16
- if (ENV.fetch("SIMP_LICENSE_KEY", nil) != nil)
16
+ if ENV.fetch('SIMP_LICENSE_KEY', nil) != nil
17
17
  describe "with edition == 'enterprise'" do
18
- it "should run without errors" do
19
- tempdir = Dir.mktmpdir("simp-media-rspec")
20
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "enterprise", "output_type" => "tar", "output" => "#{tempdir}/test.tgz"})
18
+ it 'should run without errors' do
19
+ tempdir = Dir.mktmpdir('simp-media-rspec')
20
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'enterprise', 'output_type' => 'tar', 'output' => "#{tempdir}/test.tgz")
21
21
  expect(engine.loaded?).to match(true)
22
22
  engine.run
23
- engine.cleanup()
23
+ engine.cleanup
24
24
  engine = nil
25
25
  FileUtils.rmtree(tempdir)
26
26
  end
27
27
  end
28
28
  end
29
- end
29
+ end
@@ -1,15 +1,14 @@
1
- require 'spec_helper'
1
+ require_relative '../../../spec_helper'
2
2
  require 'simp/media'
3
3
 
4
4
  describe Simp::Media::Type::Iso do
5
- xit "should run without errors" do
6
- tempdir = Dir.mktmpdir("simp-media-rspec")
7
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "community", "output_type" => "iso", "output" => "#{tempdir}/test.iso"})
5
+ xit 'should run without errors' do
6
+ tempdir = Dir.mktmpdir('simp-media-rspec')
7
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'community', 'output_type' => 'iso', 'output' => "#{tempdir}/test.iso")
8
8
  expect(engine.loaded?).to match(true)
9
9
  engine.run
10
- engine.cleanup()
10
+ engine.cleanup
11
11
  engine = nil
12
12
  FileUtils.rmtree(tempdir)
13
13
  end
14
-
15
- end
14
+ end
@@ -1,16 +1,14 @@
1
- require 'spec_helper'
1
+ require_relative '../../../spec_helper'
2
2
  require 'simp/media'
3
3
 
4
4
  describe Simp::Media::Type::Local do
5
-
6
- xit "should run without errors" do
7
- tempdir = Dir.mktmpdir("simp-media-rspec")
8
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "community", "output_type" => "local", "output" => "#{tempdir}"})
5
+ xit 'should run without errors' do
6
+ tempdir = Dir.mktmpdir('simp-media-rspec')
7
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'community', 'output_type' => 'local', 'output' => tempdir.to_s)
9
8
  expect(engine.loaded?).to match(true)
10
9
  engine.run
11
- engine.cleanup()
10
+ engine.cleanup
12
11
  engine = nil
13
12
  FileUtils.rmtree(tempdir)
14
13
  end
15
-
16
- end
14
+ end
@@ -1,16 +1,14 @@
1
- require 'spec_helper'
1
+ require_relative '../../../spec_helper'
2
2
  require 'simp/media'
3
3
 
4
4
  describe Simp::Media::Type::Tar do
5
-
6
- it "should run without errors" do
7
- tempdir = Dir.mktmpdir("simp-media-rspec")
8
- engine = Simp::Media::Engine.new({"version" => "test-stub", "edition" => "community", "output_type" => "tar", "output" => "#{tempdir}/test.tgz"})
5
+ it 'should run without errors' do
6
+ tempdir = Dir.mktmpdir('simp-media-rspec')
7
+ engine = Simp::Media::Engine.new('version' => 'test-stub', 'edition' => 'community', 'output_type' => 'tar', 'output' => "#{tempdir}/test.tgz")
9
8
  expect(engine.loaded?).to match(true)
10
9
  engine.run
11
- engine.cleanup()
10
+ engine.cleanup
12
11
  engine = nil
13
12
  FileUtils.rmtree(tempdir)
14
13
  end
15
-
16
- end
14
+ end
@@ -1,63 +1,65 @@
1
- require 'spec_helper'
1
+ require_relative '../../spec_helper'
2
2
  require 'simp/metadata'
3
+
3
4
  def test_buildinfo(type)
4
5
  Simp::Metadata::Buildinfo.new(test_component, type)
5
6
  end
7
+
6
8
  def diff_buildinfo(type)
7
9
  Simp::Metadata::Buildinfo.new(diff_component, type)
8
10
  end
9
- describe Simp::Metadata::Buildinfo do
10
11
 
11
- describe "#keys" do
12
+ describe Simp::Metadata::Buildinfo do
13
+ describe '#keys' do
12
14
  it 'should return an Array' do
13
- expect(test_buildinfo("rpm").keys.class.to_s).to eql("Array")
15
+ expect(test_buildinfo('rpm').keys.class.to_s).to eql('Array')
14
16
  end
15
- it "should return an Array of Strings" do
16
- expect(test_buildinfo("rpm").keys.all? {|output| output.class.to_s == "String"}).to eql(true)
17
+ it 'should return an Array of Strings' do
18
+ expect(test_buildinfo('rpm').keys.all? { |output| output.class.to_s == 'String' }).to eql(true)
17
19
  end
18
20
  end
19
- describe "#type" do
21
+ describe '#type' do
20
22
  context "when type == 'rpm'" do
21
23
  it 'should return a String' do
22
- expect(test_buildinfo("rpm").type.class.to_s).to eql("String")
24
+ expect(test_buildinfo('rpm').type.class.to_s).to eql('String')
23
25
  end
24
26
  it "should return 'rpm'" do
25
- expect(test_buildinfo("rpm").type).to eql("rpm")
27
+ expect(test_buildinfo('rpm').type).to eql('rpm')
26
28
  end
27
29
  end
28
30
  end
29
31
  describe "#['type']" do
30
32
  context "when type == 'rpm'" do
31
33
  it 'should return a String' do
32
- expect(test_buildinfo("rpm")['type'].class.to_s).to eql("String")
34
+ expect(test_buildinfo('rpm')['type'].class.to_s).to eql('String')
33
35
  end
34
36
  it "should return 'rpm'" do
35
- expect(test_buildinfo("rpm")['type']).to eql("rpm")
37
+ expect(test_buildinfo('rpm')['type']).to eql('rpm')
36
38
  end
37
39
  end
38
40
  end
39
- describe "#build_method" do
41
+ describe '#build_method' do
40
42
  context "when type == 'rpm'" do
41
43
  it 'should return a String' do
42
- expect(test_buildinfo("rpm").build_method.class.to_s).to eql("String")
44
+ expect(test_buildinfo('rpm').build_method.class.to_s).to eql('String')
43
45
  end
44
46
  it "should return 'simp-core'" do
45
- expect(test_buildinfo("rpm").build_method).to eql("simp-core")
47
+ expect(test_buildinfo('rpm').build_method).to eql('simp-core')
46
48
  end
47
49
  end
48
50
  context "when simp-metadata == 'metadata-build'" do
49
51
  it "should return 'metadata-build'" do
50
- expect(diff_buildinfo("rpm").build_method).to eql("metadata-build")
52
+ expect(diff_buildinfo('rpm').build_method).to eql('metadata-build')
51
53
  end
52
54
  end
53
55
  end
54
56
  describe "#['build_method']" do
55
57
  context "when type == 'rpm'" do
56
58
  it 'should return a String' do
57
- expect(test_buildinfo("rpm")['build_method'].class.to_s).to eql("String")
59
+ expect(test_buildinfo('rpm')['build_method'].class.to_s).to eql('String')
58
60
  end
59
61
  it "should return 'simp-core'" do
60
- expect(test_buildinfo("rpm")['build_method']).to eql("simp-core")
62
+ expect(test_buildinfo('rpm')['build_method']).to eql('simp-core')
61
63
  end
62
64
  end
63
65
  end
@@ -1,8 +1,9 @@
1
- require 'spec_helper'
1
+ require_relative '../../../spec_helper'
2
2
  require 'simp/metadata'
3
3
  require 'simp/metadata/commands/clone'
4
+
4
5
  describe Simp::Metadata::Commands::Clone do
5
- xit "should execute successfully" do
6
+ xit 'should execute successfully' do
6
7
  # We need to stub the writable urls here.
7
8
  end
8
- end
9
+ end
@@ -1,89 +1,78 @@
1
- require 'spec_helper'
1
+ require_relative '../../spec_helper'
2
2
  require 'simp/metadata'
3
3
  require 'simp/metadata/commands/clone'
4
4
  describe Simp::Metadata::Component do
5
-
6
- describe "#view" do
5
+ describe '#view' do
7
6
  context 'when attribute = nil' do
8
- it "should return all information" do
9
- release = 'test-stub'
10
- component = 'pupmod-simp-activemq'
7
+ it 'should return all information' do
11
8
  attribute = nil
12
- test = component_view_instance(release, component, attribute)
13
- expect(test).to eql("asset_name" => "activemq",
14
- "authoritative" => "true",
15
- "branch" => "master",
16
- "component_source" => "simp-metadata",
17
- "component_type" => "puppet-module",
18
- "extension" => "tgz",
19
- "extract" => "false",
20
- "format" => "git",
21
- "location" => {"extract" => "false", "primary" => "false", "method" => "git", "url" => "https://gitlab.com/simp/simp-activemq"},
22
- "method" => "git",
23
- "module_name" => "activemq",
24
- "ref" => "488f5a0d5b53063c125b93a596626193b71aaa08",
25
- "release_source" => "simp-metadata",
26
- "tag" => "1.1.1",
27
- "url" => "https://github.com/simp/pupmod-simp-activemq",
28
- "version" => "1.1.1",
29
- )
9
+ test = component_view_instance(attribute)
10
+ expect(test).to eql('asset_name' => 'activemq',
11
+ 'authoritative' => 'true',
12
+ 'branch' => 'master',
13
+ 'component_source' => 'simp-metadata',
14
+ 'component_type' => 'puppet-module',
15
+ 'extension' => 'tgz',
16
+ 'extract' => 'false',
17
+ 'location' => { 'extract' => 'false', 'primary' => 'true', 'method' => 'git', 'url' => 'https://github.com/simp/pupmod-simp-activemq' },
18
+ 'method' => 'git',
19
+ 'module_name' => 'activemq',
20
+ 'ref' => '488f5a0d5b53063c125b93a596626193b71aaa08',
21
+ 'release_source' => 'simp-metadata',
22
+ 'revision' => '0',
23
+ 'tag' => '1.1.1',
24
+ 'target' => 'noarch',
25
+ 'url' => 'https://github.com/simp/pupmod-simp-activemq',
26
+ 'version' => '1.1.1')
30
27
  end
31
28
  end
32
29
  context 'when attribute = version' do
33
- it "should return only the version" do
34
- release = 'test-stub'
35
- component = 'pupmod-simp-activemq'
30
+ it 'should return only the version' do
36
31
  attribute = 'version'
37
- test = component_view_instance(release, component, attribute)
38
- expect(test).to eql("version" => "1.1.1")
32
+ test = component_view_instance(attribute)
33
+ expect(test).to eql('version' => '1.1.1')
39
34
  end
40
35
  end
41
36
  end
42
37
 
43
- describe "#diff" do
38
+ describe '#diff' do
44
39
  context 'when attribute = nil' do
45
- it "should return all information" do
46
- release1 = 'test-stub'
47
- release2 = 'test-diff'
40
+ it 'should return all information' do
48
41
  attribute = nil
49
- component = 'pupmod-simp-activemq'
50
- test = component_diff_instance(release1, release2, component, attribute)
51
- expect(test).to eql("branch" => {"original" => "master", "changed" => "develop"},
52
- "ref" => {"original" => "488f5a0d5b53063c125b93a596626193b71aaa08", "changed" => "3987ra0d5b53063f493b93a596626193b71dddd4"},
53
- "tag" => {"original" => "1.1.1", "changed" => "1.1.2"},
54
- "version" => {"original" => "1.1.1", "changed" => "1.1.2"})
42
+ test = component_diff_instance(attribute)
43
+ expect(test).to eql('branch' => { 'original' => 'master', 'changed' => 'develop' },
44
+ 'ref' => { 'original' => '488f5a0d5b53063c125b93a596626193b71aaa08', 'changed' => '3987ra0d5b53063f493b93a596626193b71dddd4' },
45
+ 'tag' => { 'original' => '1.1.1', 'changed' => '1.1.2' },
46
+ 'version' => { 'original' => '1.1.1', 'changed' => '1.1.2' })
55
47
  end
56
48
  end
57
49
  context 'when attribute = version' do
58
- it "should return only the version" do
59
- release1 = 'test-stub'
60
- release2 = 'test-diff'
50
+ it 'should return only the version' do
61
51
  attribute = 'version'
62
- component = 'pupmod-simp-activemq'
63
- test = component_diff_instance(release1, release2, component, attribute)
64
- expect(test).to eql("version" => {"original" => "1.1.1", "changed" => "1.1.2"})
52
+ test = component_diff_instance(attribute)
53
+ expect(test).to eql('version' => { 'original' => '1.1.1', 'changed' => '1.1.2' })
65
54
  end
66
55
  end
67
56
  end
68
- describe "#buildinfo" do
57
+ describe '#buildinfo' do
69
58
  context 'when type = nil' do
70
- it "should return a Hash" do
71
- expect(test_component.buildinfo().class.to_s).to eql("Hash")
59
+ it 'should return a Hash' do
60
+ expect(test_component.buildinfo.class.to_s).to eql('Hash')
72
61
  end
73
- it "should contain only Simp::Metadata::Buildinfo objects" do
74
- expect(test_component.buildinfo.all? { |buildinfo| buildinfo.class.to_s == "Simp::Metadata::Buildinfo"}).to eql(true)
62
+ it 'should contain only Simp::Metadata::Buildinfo objects' do
63
+ expect(test_component.buildinfo.all? { |buildinfo| buildinfo.class.to_s == 'Simp::Metadata::Buildinfo' }).to eql(true)
75
64
  end
76
65
  end
77
66
 
78
67
  context "when type = 'rpm'" do
79
- it "should return a Simp::Metadata::Buildinfo object" do
80
- expect(test_component.buildinfo("rpm").class.to_s).to eql("Simp::Metadata::Buildinfo")
68
+ it 'should return a Simp::Metadata::Buildinfo object' do
69
+ expect(test_component.buildinfo('rpm').class.to_s).to eql('Simp::Metadata::Buildinfo')
81
70
  end
82
71
  it "should be of type 'rpm'" do
83
- expect(test_component.buildinfo("rpm").type).to eql("rpm")
72
+ expect(test_component.buildinfo('rpm').type).to eql('rpm')
84
73
  end
85
74
  it "should be of build_method 'simp-core'" do
86
- expect(test_component.buildinfo("rpm").build_method).to eql("simp-core")
75
+ expect(test_component.buildinfo('rpm').build_method).to eql('simp-core')
87
76
  end
88
77
  end
89
78
  end
@@ -1,70 +1,67 @@
1
- require 'spec_helper'
1
+ require_relative '../../spec_helper'
2
2
  require 'simp/metadata'
3
3
  describe Simp::Metadata::Engine do
4
-
5
- it "should instantiate without errors" do
6
- expect {
4
+ it 'should instantiate without errors' do
5
+ expect do
7
6
  engine = Simp::Metadata::Engine.new
8
7
 
9
- engine.cleanup()
8
+ engine.cleanup
10
9
  engine = nil
11
- }.not_to raise_error()
10
+ end.not_to raise_error
12
11
  end
13
- it "dirty? should return false" do
14
-
12
+ it 'dirty? should return false' do
15
13
  engine = Simp::Metadata::Engine.new
16
14
  expect(engine.dirty?).to eql(false)
17
- engine.cleanup()
15
+ engine.cleanup
18
16
  engine = nil
19
17
  end
20
- it "save should run without errors" do
21
- expect {
18
+ it 'save should run without errors' do
19
+ expect do
22
20
  engine = Simp::Metadata::Engine.new
23
21
 
24
- engine.save()
25
- engine.cleanup()
22
+ engine.save
23
+ engine.cleanup
26
24
  engine = nil
27
- }.not_to raise_error()
25
+ end.not_to raise_error
28
26
  end
29
- it "cleanup should run without errors" do
30
- expect {
27
+ it 'cleanup should run without errors' do
28
+ expect do
31
29
  engine = Simp::Metadata::Engine.new
32
30
 
33
- engine.cleanup()
31
+ engine.cleanup
34
32
  engine = nil
35
- }.not_to raise_error()
33
+ end.not_to raise_error
36
34
  end
37
- describe "components" do
38
- it "should run without errors" do
39
- expect {
40
- engine = Simp::Metadata::Engine.new
41
-
42
- engine.components()
43
- engine = nil
44
- }.not_to raise_error()
45
- end
46
- it "should return a Simp::Metadata::Components object" do
35
+ describe 'components' do
36
+ it 'should run without errors' do
37
+ expect do
47
38
  engine = Simp::Metadata::Engine.new
48
- expect(engine.components.class.to_s).to eql("Simp::Metadata::Components")
49
- engine.cleanup()
39
+
40
+ engine.components
50
41
  engine = nil
51
- end
42
+ end.not_to raise_error
43
+ end
44
+ it 'should return a Simp::Metadata::Components object' do
45
+ engine = Simp::Metadata::Engine.new
46
+ expect(engine.components.class.to_s).to eql('Simp::Metadata::Components')
47
+ engine.cleanup
48
+ engine = nil
49
+ end
52
50
  end
53
- describe "releases" do
54
- it "should run without errors" do
55
- expect {
51
+ describe 'releases' do
52
+ it 'should run without errors' do
53
+ expect do
56
54
  engine = Simp::Metadata::Engine.new
57
55
 
58
- engine.releases()
56
+ engine.releases
59
57
  engine = nil
60
- }.not_to raise_error()
58
+ end.not_to raise_error
61
59
  end
62
- it "should return a Simp::Metadata::Releases object" do
60
+ it 'should return a Simp::Metadata::Releases object' do
63
61
  engine = Simp::Metadata::Engine.new
64
- expect(engine.releases.class.to_s).to eql("Simp::Metadata::Releases")
65
- engine.cleanup()
62
+ expect(engine.releases.class.to_s).to eql('Simp::Metadata::Releases')
63
+ engine.cleanup
66
64
  engine = nil
67
65
  end
68
66
  end
69
-
70
- end
67
+ end