simp-metadata 0.4.4 → 0.5.2
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.
- checksums.yaml +5 -5
- data/README.md +494 -0
- data/Rakefile +19 -22
- data/exe/simp-install +1 -1
- data/exe/simp-media +1 -1
- data/exe/simp-metadata +1 -1
- data/lib/simp/install/command.rb +34 -35
- data/lib/simp/media.rb +0 -1
- data/lib/simp/media/command.rb +34 -35
- data/lib/simp/media/engine.rb +29 -35
- data/lib/simp/media/type.rb +1 -2
- data/lib/simp/media/type/base.rb +12 -4
- data/lib/simp/media/type/control-repo.rb +96 -107
- data/lib/simp/media/type/internet.rb +8 -8
- data/lib/simp/media/type/iso.rb +0 -1
- data/lib/simp/media/type/local.rb +18 -19
- data/lib/simp/media/type/tar.rb +37 -37
- data/lib/simp/metadata.rb +240 -258
- data/lib/simp/metadata/bootstrap_source.rb +93 -89
- data/lib/simp/metadata/buildinfo.rb +23 -23
- data/lib/simp/metadata/command.rb +60 -58
- data/lib/simp/metadata/commands.rb +1 -1
- data/lib/simp/metadata/commands/base.rb +28 -25
- data/lib/simp/metadata/commands/clone.rb +3 -5
- data/lib/simp/metadata/commands/component.rb +128 -90
- data/lib/simp/metadata/commands/delete.rb +4 -5
- data/lib/simp/metadata/commands/pry.rb +1 -3
- data/lib/simp/metadata/commands/release.rb +22 -23
- data/lib/simp/metadata/commands/releases.rb +1 -3
- data/lib/simp/metadata/commands/save.rb +10 -13
- data/lib/simp/metadata/commands/script.rb +11 -14
- data/lib/simp/metadata/commands/search.rb +15 -20
- data/lib/simp/metadata/commands/set-write-url.rb +1 -3
- data/lib/simp/metadata/commands/set-write.rb +1 -3
- data/lib/simp/metadata/commands/update.rb +9 -10
- data/lib/simp/metadata/component.rb +310 -154
- data/lib/simp/metadata/components.rb +15 -16
- data/lib/simp/metadata/engine.rb +31 -39
- data/lib/simp/metadata/fake_uri.rb +2 -0
- data/lib/simp/metadata/location.rb +99 -105
- data/lib/simp/metadata/locations.rb +19 -21
- data/lib/simp/metadata/release.rb +30 -39
- data/lib/simp/metadata/releases.rb +14 -15
- data/lib/simp/metadata/source.rb +69 -79
- data/lib/simp/metadata/version.rb +9 -0
- data/spec/simp/media/command_spec.rb +4 -5
- data/spec/simp/media/engine_spec.rb +14 -14
- data/spec/simp/media/type/control_repo_spec.rb +10 -12
- data/spec/simp/media/type/internet_spec.rb +11 -11
- data/spec/simp/media/type/iso_spec.rb +6 -7
- data/spec/simp/media/type/local_spec.rb +6 -8
- data/spec/simp/media/type/tar_spec.rb +6 -8
- data/spec/simp/metadata/buildinfo_spec.rb +19 -17
- data/spec/simp/metadata/commands/clone_spec.rb +4 -3
- data/spec/simp/metadata/component_spec.rb +43 -54
- data/spec/simp/metadata/engine_spec.rb +38 -41
- data/spec/simp/metadata/release_spec.rb +72 -79
- data/spec/simp/metadata/source_spec.rb +8 -6
- data/spec/simp/metadata_spec.rb +95 -98
- data/spec/spec_helper.rb +33 -21
- metadata +5 -3
@@ -1,101 +1,94 @@
|
|
1
|
-
|
1
|
+
require_relative '../../spec_helper'
|
2
2
|
require 'simp/metadata'
|
3
3
|
require 'simp/metadata/commands/clone'
|
4
4
|
|
5
5
|
describe Simp::Metadata::Release do
|
6
6
|
describe '#puppetfile' do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
7
|
+
context 'when type == nil' do
|
8
|
+
it 'should return a String' do
|
9
|
+
engine = Simp::Metadata::Engine.new
|
10
|
+
release = engine.releases['test-stub']
|
11
|
+
puppetfile = release.puppetfile
|
12
|
+
expect(puppetfile.class.to_s).to eql('String')
|
13
|
+
engine.cleanup
|
14
|
+
engine = nil
|
15
|
+
end
|
17
16
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
17
|
+
it 'should return a valid Puppetfile' do
|
18
|
+
engine = Simp::Metadata::Engine.new
|
19
|
+
release = engine.releases['test-stub']
|
20
|
+
puppetfile = release.puppetfile
|
21
|
+
expect(puppetfile.split("\n").size).to be > 2
|
22
|
+
expect(puppetfile).to match(/^mod.*'.*',/)
|
23
|
+
expect(puppetfile).to match(/^\s{2}:git => 'https:\/\/github.com.*',/)
|
24
|
+
expect(puppetfile).to match(/^\s{2}:tag => '[0-9]+.[0-9]+.[0-9]+'/)
|
25
|
+
engine.cleanup
|
26
|
+
engine = nil
|
27
|
+
end
|
28
28
|
end
|
29
|
-
end
|
30
|
-
|
31
|
-
context "when type == 'simp-core'" do
|
32
29
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
30
|
+
context "when type == 'simp-core'" do
|
31
|
+
it 'should return a String' do
|
32
|
+
engine = Simp::Metadata::Engine.new
|
33
|
+
release = engine.releases['test-stub']
|
34
|
+
puppetfile = release.puppetfile('simp-core')
|
35
|
+
expect(puppetfile.class.to_s).to eql('String')
|
36
|
+
engine.cleanup
|
37
|
+
engine = nil
|
38
|
+
end
|
41
39
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
40
|
+
it 'should return a valid Puppetfile' do
|
41
|
+
engine = Simp::Metadata::Engine.new
|
42
|
+
release = engine.releases['test-stub']
|
43
|
+
puppetfile = release.puppetfile('simp-core')
|
44
|
+
expect(puppetfile.split("\n").size).to be > 2
|
45
|
+
expect(puppetfile).to match(/^mod.*'.*',/)
|
46
|
+
expect(puppetfile).to match(/^\s{2}:git => 'https:\/\/github.com.*',/)
|
47
|
+
expect(puppetfile).to match(/^\s{2}:tag => '[0-9]+.[0-9]+.[0-9]+'/)
|
48
|
+
engine.cleanup
|
49
|
+
engine = nil
|
50
|
+
end
|
52
51
|
end
|
53
52
|
end
|
54
|
-
|
55
|
-
describe "#diff" do
|
53
|
+
describe '#diff' do
|
56
54
|
context 'when attribute is nil' do
|
57
|
-
|
58
|
-
it "should return all differences" do
|
59
|
-
release1 = 'test-stub'
|
60
|
-
release2 = 'test-diff'
|
55
|
+
it 'should return all differences' do
|
61
56
|
attribute = nil
|
62
|
-
test = release_diff_instance(
|
57
|
+
test = release_diff_instance(attribute)
|
63
58
|
expect(test).to eql(
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
59
|
+
'pupmod-simp-activemq' => {
|
60
|
+
'branch' => {
|
61
|
+
'original' => 'master',
|
62
|
+
'changed' => 'develop'
|
63
|
+
},
|
64
|
+
'tag' => {
|
65
|
+
'original' => '1.1.1',
|
66
|
+
'changed' => '1.1.2'
|
67
|
+
},
|
68
|
+
'ref' => {
|
69
|
+
'original' => '488f5a0d5b53063c125b93a596626193b71aaa08',
|
70
|
+
'changed' => '3987ra0d5b53063f493b93a596626193b71dddd4'
|
71
|
+
},
|
72
|
+
'version' => {
|
73
|
+
'original' => '1.1.1',
|
74
|
+
'changed' => '1.1.2'
|
75
|
+
}
|
76
|
+
}
|
77
|
+
)
|
83
78
|
end
|
84
79
|
end
|
85
80
|
context 'when attribute is "version"' do
|
86
|
-
it
|
87
|
-
release1 = 'test-stub'
|
88
|
-
release2 = 'test-diff'
|
81
|
+
it 'should return only version' do
|
89
82
|
attribute = 'version'
|
90
|
-
test = release_diff_instance(
|
83
|
+
test = release_diff_instance(attribute)
|
91
84
|
expect(test).to eql(
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
85
|
+
'pupmod-simp-activemq' => {
|
86
|
+
'version' => {
|
87
|
+
'original' => '1.1.1',
|
88
|
+
'changed' => '1.1.2'
|
89
|
+
}
|
90
|
+
}
|
91
|
+
)
|
99
92
|
end
|
100
93
|
end
|
101
94
|
end
|
@@ -1,10 +1,12 @@
|
|
1
|
-
|
1
|
+
require_relative '../../spec_helper'
|
2
2
|
require 'simp/metadata'
|
3
|
+
|
4
|
+
# Need to fix test
|
3
5
|
describe Simp::Metadata::Source do
|
4
|
-
it
|
5
|
-
expect
|
6
|
-
source = Simp::Metadata::Source.new
|
7
|
-
|
6
|
+
it 'should require a URL to be specified' do
|
7
|
+
expect do
|
8
|
+
source = Simp::Metadata::Source.new
|
9
|
+
end.to raise_error(ArgumentError)
|
8
10
|
end
|
9
11
|
# it "should instantiate when passed a valid metadata source" do
|
10
12
|
# expect {
|
@@ -22,4 +24,4 @@ describe Simp::Metadata::Source do
|
|
22
24
|
# FileUtils.rmtree(tempdir)
|
23
25
|
# }.not_to raise_error
|
24
26
|
# end
|
25
|
-
end
|
27
|
+
end
|
data/spec/simp/metadata_spec.rb
CHANGED
@@ -1,174 +1,171 @@
|
|
1
|
-
|
1
|
+
require_relative '../spec_helper'
|
2
2
|
require 'simp/metadata'
|
3
3
|
|
4
|
-
shared_examples_for
|
5
|
-
it
|
4
|
+
shared_examples_for 'log_wrapper' do |method_name|
|
5
|
+
it 'should not throw an error' do
|
6
6
|
$simp_metadata_debug_level = 'debug2'
|
7
|
-
tempdir = Dir.mktmpdir(
|
8
|
-
expect { Simp::Metadata.send(method_name,
|
7
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
8
|
+
expect { Simp::Metadata.send(method_name, 'test') }.not_to raise_error
|
9
9
|
FileUtils.rmtree(tempdir)
|
10
|
-
|
11
|
-
it
|
12
|
-
tempdir = Dir.mktmpdir(
|
10
|
+
end
|
11
|
+
it 'should not throw an error if logging is disabled' do
|
12
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
13
13
|
$simp_metadata_debug_level = 'disabled'
|
14
|
-
expect { Simp::Metadata.send(method_name,
|
14
|
+
expect { Simp::Metadata.send(method_name, 'test') }.not_to raise_error
|
15
15
|
FileUtils.rmtree(tempdir)
|
16
16
|
$simp_metadata_debug_level = 'debug2'
|
17
17
|
end
|
18
|
-
it
|
19
|
-
tempdir = Dir.mktmpdir(
|
20
|
-
$simp_metadata_debug_level = '
|
21
|
-
expect { Simp::Metadata.send(method_name,
|
18
|
+
it 'should not throw an error if logging is left default' do
|
19
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
20
|
+
$simp_metadata_debug_level = 'warning'
|
21
|
+
expect { Simp::Metadata.send(method_name, 'test') }.not_to raise_error
|
22
22
|
FileUtils.rmtree(tempdir)
|
23
23
|
$simp_metadata_debug_level = 'debug2'
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
shared_examples_for
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
expect { Simp::Metadata.download_component(component, {"target" => tempdir})}.not_to raise_error
|
27
|
+
shared_examples_for 'download_component' do |component|
|
28
|
+
it 'should not throw an error' do
|
29
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
30
|
+
expect { Simp::Metadata.download_component(component, 'target' => tempdir) }.not_to raise_error
|
32
31
|
FileUtils.rmtree(tempdir)
|
33
32
|
end
|
34
|
-
it
|
35
|
-
tempdir = Dir.mktmpdir(
|
36
|
-
retval = Simp::Metadata.download_component(component,
|
37
|
-
expect(retval.class.to_s).to eql(
|
33
|
+
it 'should return a hash' do
|
34
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
35
|
+
retval = Simp::Metadata.download_component(component, 'target' => tempdir)
|
36
|
+
expect(retval.class.to_s).to eql('Hash')
|
38
37
|
FileUtils.rmtree(tempdir)
|
39
38
|
end
|
40
|
-
it
|
41
|
-
tempdir = Dir.mktmpdir(
|
42
|
-
retval = Simp::Metadata.download_component(component,
|
43
|
-
expect(retval.key?(
|
39
|
+
it 'should return a path key' do
|
40
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
41
|
+
retval = Simp::Metadata.download_component(component, 'target' => tempdir)
|
42
|
+
expect(retval.key?('path')).to eql(true)
|
44
43
|
FileUtils.rmtree(tempdir)
|
45
44
|
end
|
46
|
-
it
|
47
|
-
tempdir = Dir.mktmpdir(
|
48
|
-
retval = Simp::Metadata.download_component(component,
|
49
|
-
expect(retval[
|
45
|
+
it 'should return a path key that is within the tempdir' do
|
46
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
47
|
+
retval = Simp::Metadata.download_component(component, 'target' => tempdir)
|
48
|
+
expect(retval['path']).to match(/^#{tempdir}/)
|
50
49
|
FileUtils.rmtree(tempdir)
|
51
50
|
end
|
52
51
|
end
|
53
52
|
describe Simp::Metadata do
|
54
|
-
describe
|
55
|
-
it_should_behave_like
|
53
|
+
describe 'Simp::Metadata.debug2' do
|
54
|
+
it_should_behave_like 'log_wrapper', :debug2
|
56
55
|
end
|
57
|
-
describe
|
58
|
-
it_should_behave_like
|
56
|
+
describe 'Simp::Metadata.debug1' do
|
57
|
+
it_should_behave_like 'log_wrapper', :debug1
|
59
58
|
end
|
60
|
-
describe
|
61
|
-
it_should_behave_like
|
59
|
+
describe 'Simp::Metadata.info' do
|
60
|
+
it_should_behave_like 'log_wrapper', :info
|
62
61
|
end
|
63
|
-
describe
|
64
|
-
it_should_behave_like
|
62
|
+
describe 'Simp::Metadata.warning' do
|
63
|
+
it_should_behave_like 'log_wrapper', :warning
|
65
64
|
end
|
66
|
-
describe
|
67
|
-
it_should_behave_like
|
65
|
+
describe 'Simp::Metadata.error' do
|
66
|
+
it_should_behave_like 'log_wrapper', :error
|
68
67
|
end
|
69
|
-
describe
|
70
|
-
it_should_behave_like
|
68
|
+
describe 'Simp::Metadata.critical' do
|
69
|
+
it_should_behave_like 'log_wrapper', :critical
|
71
70
|
end
|
72
|
-
describe
|
73
|
-
it
|
71
|
+
describe 'Simp::Metadata.run' do
|
72
|
+
it 'should run a command with no errors' do
|
74
73
|
# Create an output capture system.
|
75
74
|
errorcode = Simp::Metadata.run("echo 'successful'")
|
76
75
|
expect(errorcode.success?).to eql(true)
|
77
76
|
end
|
78
|
-
it
|
77
|
+
it 'should return an error on a non-zero exit code' do
|
79
78
|
# Create an output capture system.
|
80
|
-
errorcode = Simp::Metadata.run(
|
79
|
+
errorcode = Simp::Metadata.run('false')
|
81
80
|
expect(errorcode.success?).to eql(false)
|
82
81
|
end
|
83
82
|
end
|
84
|
-
describe
|
85
|
-
|
86
|
-
it "should return a filename and a data stream" do
|
83
|
+
describe 'Simp::Metadata.get_license_data' do
|
84
|
+
it 'should return a filename and a data stream' do
|
87
85
|
# Create an output capture system.
|
88
86
|
filename, data = Simp::Metadata.get_license_data(nil)
|
89
|
-
expect(filename.class.to_s).to eql(
|
90
|
-
expect(data.class.to_s).to eql(
|
91
|
-
expect(File.
|
87
|
+
expect(filename.class.to_s).to eql('String')
|
88
|
+
expect(data.class.to_s).to eql('String')
|
89
|
+
expect(File.exist?(filename)).to eql(true)
|
92
90
|
end
|
93
91
|
end
|
94
|
-
describe
|
95
|
-
it
|
96
|
-
expect { Simp::Metadata.download_component(nil, {})}.to raise_error(RuntimeError, "Must specify 'target'")
|
92
|
+
describe 'Simp::Metadata.download_component' do
|
93
|
+
it 'should throw an error if target is not specified' do
|
94
|
+
expect { Simp::Metadata.download_component(nil, {}) }.to raise_error(RuntimeError, "Must specify 'target'")
|
97
95
|
end
|
98
|
-
it
|
99
|
-
tempdir = Dir.mktmpdir(
|
100
|
-
expect { Simp::Metadata.download_component(nil,
|
96
|
+
it 'should throw an error if component is nil' do
|
97
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
98
|
+
expect { Simp::Metadata.download_component(nil, 'target' => tempdir) }.to raise_error(RuntimeError, "component.class=NilClass, NilClass is not in ['String', 'Simp::Metadata::Component']")
|
101
99
|
FileUtils.rmtree(tempdir)
|
102
100
|
end
|
103
|
-
it
|
104
|
-
tempdir = Dir.mktmpdir(
|
105
|
-
expect { Simp::Metadata.download_component([],
|
101
|
+
it 'should throw an error if component is not a string or Simp::Metadata::Component' do
|
102
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
103
|
+
expect { Simp::Metadata.download_component([], 'target' => tempdir) }.to raise_error(RuntimeError, "component.class=Array, Array is not in ['String', 'Simp::Metadata::Component']")
|
106
104
|
FileUtils.rmtree(tempdir)
|
107
105
|
end
|
108
106
|
describe "when component == 'simp-metadata'" do
|
109
|
-
it_should_behave_like
|
107
|
+
it_should_behave_like 'download_component', 'simp-metadata'
|
110
108
|
end
|
111
|
-
describe
|
112
|
-
engine = Simp::Metadata::Engine.new
|
113
|
-
component = engine.components[
|
114
|
-
it_should_behave_like
|
109
|
+
describe 'when component is a Simp::Metadata::Component' do
|
110
|
+
engine = Simp::Metadata::Engine.new
|
111
|
+
component = engine.components['pupmod-simp-activemq']
|
112
|
+
it_should_behave_like 'download_component', component
|
115
113
|
end
|
116
|
-
if
|
114
|
+
if ENV.fetch('SIMP_LICENSE_KEY', nil) != nil
|
117
115
|
describe "when component == 'enterprise-metadata'" do
|
118
|
-
it_should_behave_like
|
116
|
+
it_should_behave_like 'download_component', 'enterprise-metadata'
|
119
117
|
end
|
120
118
|
end
|
121
119
|
end
|
122
120
|
|
123
|
-
describe
|
124
|
-
|
121
|
+
describe 'Simp::Metadata.fetch_from_url' do
|
125
122
|
it "should throw an error when urlspec is a 'ftp' String" do
|
126
|
-
tempdir = Dir.mktmpdir(
|
127
|
-
expect { Simp::Metadata.fetch_from_url(
|
123
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
124
|
+
expect { Simp::Metadata.fetch_from_url('ftp://github.com/simp/simp-metadata/archive/master.zip', "#{tempdir}/master.zip", 'simp-metadata', 'target' => tempdir) }.to raise_error(RuntimeError, 'unsupported url type ftp')
|
128
125
|
FileUtils.rmtree(tempdir)
|
129
126
|
end
|
130
|
-
it
|
131
|
-
tempdir = Dir.mktmpdir(
|
132
|
-
expect { Simp::Metadata.fetch_from_url(
|
127
|
+
it 'should not throw an error when urlspec is an https String' do
|
128
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
129
|
+
expect { Simp::Metadata.fetch_from_url('https://github.com/simp/simp-metadata/archive/master.zip', "#{tempdir}/master.zip", 'simp-metadata', 'target' => tempdir) }.not_to raise_error
|
133
130
|
FileUtils.rmtree(tempdir)
|
134
131
|
end
|
135
|
-
it
|
136
|
-
tempdir = Dir.mktmpdir(
|
137
|
-
expect { Simp::Metadata.fetch_from_url(
|
132
|
+
it 'should not throw an error when urlspec is an http String' do
|
133
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
134
|
+
expect { Simp::Metadata.fetch_from_url('http://github.com/simp/simp-metadata/archive/master.zip', "#{tempdir}/master.zip", 'simp-metadata', 'target' => tempdir) }.not_to raise_error
|
138
135
|
FileUtils.rmtree(tempdir)
|
139
136
|
end
|
140
137
|
it "should not throw an error when urlspec is a hash with just a 'url' element" do
|
141
|
-
tempdir = Dir.mktmpdir(
|
142
|
-
expect { Simp::Metadata.fetch_from_url({
|
138
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
139
|
+
expect { Simp::Metadata.fetch_from_url({ 'url' => 'https://github.com/simp/simp-metadata/archive/master.zip' }, "#{tempdir}/master.zip", 'simp-metadata', 'target' => tempdir) }.not_to raise_error
|
143
140
|
FileUtils.rmtree(tempdir)
|
144
141
|
end
|
145
|
-
it
|
146
|
-
tempdir = Dir.mktmpdir(
|
147
|
-
expect { Simp::Metadata.fetch_from_url({
|
142
|
+
it 'should not throw an error when type == file' do
|
143
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
144
|
+
expect { Simp::Metadata.fetch_from_url({ 'type' => 'file', 'url' => 'https://github.com/simp/simp-metadata/archive/master.zip' }, "#{tempdir}/master.zip", 'simp-metadata', 'target' => tempdir) }.not_to raise_error
|
148
145
|
FileUtils.rmtree(tempdir)
|
149
146
|
end
|
150
|
-
it
|
151
|
-
tempdir = Dir.mktmpdir(
|
152
|
-
expect { Simp::Metadata.fetch_from_url({
|
147
|
+
it 'should not throw an error when type == git' do
|
148
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
149
|
+
expect { Simp::Metadata.fetch_from_url({ 'type' => 'git', 'url' => 'https://github.com/simp/simp-metadata' }, "#{tempdir}/simp-metadata", 'simp-metadata', 'target' => tempdir) }.not_to raise_error
|
153
150
|
# Test git pull origin code path as well
|
154
|
-
expect { Simp::Metadata.fetch_from_url({
|
151
|
+
expect { Simp::Metadata.fetch_from_url({ 'type' => 'git', 'url' => 'https://github.com/simp/simp-metadata' }, "#{tempdir}/simp-metadata", 'simp-metadata', 'target' => tempdir) }.not_to raise_error
|
155
152
|
FileUtils.rmtree(tempdir)
|
156
153
|
end
|
157
154
|
end
|
158
155
|
|
159
|
-
describe
|
160
|
-
it
|
161
|
-
tempdir = Dir.mktmpdir(
|
162
|
-
engine = Simp::Metadata::Engine.new
|
163
|
-
component = engine.components[
|
164
|
-
expect { Simp::Metadata.fetch_simp_enterprise(component.primary.url,"#{tempdir}/simp-metadata",component, component.primary,
|
156
|
+
describe 'Simp::Metadata.fetch_simp_enterprise' do
|
157
|
+
it 'should not throw an error when location is a location' do
|
158
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
159
|
+
engine = Simp::Metadata::Engine.new
|
160
|
+
component = engine.components['pupmod-simp-activemq']
|
161
|
+
expect { Simp::Metadata.fetch_simp_enterprise(component.primary.url, "#{tempdir}/simp-metadata", component, component.primary, 'target' => tempdir) }.not_to raise_error
|
165
162
|
FileUtils.rmtree(tempdir)
|
166
163
|
end
|
167
|
-
xit
|
168
|
-
tempdir = Dir.mktmpdir(
|
169
|
-
engine = Simp::Metadata::Engine.new(nil, nil,
|
170
|
-
component = engine.components[
|
171
|
-
expect { Simp::Metadata.fetch_simp_enterprise(component.primary.url,"#{tempdir}/simp-metadata",component, component.primary,
|
164
|
+
xit 'should not throw an error when downloading a simp-metadata url' do
|
165
|
+
tempdir = Dir.mktmpdir('simp-media-rspec')
|
166
|
+
engine = Simp::Metadata::Engine.new(nil, nil, 'enterprise')
|
167
|
+
component = engine.components['enterprise-metadata']
|
168
|
+
expect { Simp::Metadata.fetch_simp_enterprise(component.primary.url, "#{tempdir}/simp-metadata", component, component.primary, 'target' => tempdir) }.not_to raise_error
|
172
169
|
FileUtils.rmtree(tempdir)
|
173
170
|
end
|
174
171
|
end
|