omnibus 5.4.0 → 5.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/CHANGELOG.md +21 -0
- data/Gemfile +8 -5
- data/README.md +3 -1
- data/Rakefile +20 -13
- data/appveyor.yml +4 -3
- data/bin/omnibus +3 -3
- data/features/commands/manifest.feature +19 -5
- data/features/step_definitions/generator_steps.rb +5 -6
- data/features/support/env.rb +4 -4
- data/lib/omnibus/build_version.rb +14 -14
- data/lib/omnibus/build_version_dsl.rb +3 -3
- data/lib/omnibus/builder.rb +50 -61
- data/lib/omnibus/changelog.rb +2 -2
- data/lib/omnibus/changelog_printer.rb +4 -4
- data/lib/omnibus/cleaner.rb +4 -4
- data/lib/omnibus/cli/base.rb +15 -15
- data/lib/omnibus/cli/cache.rb +13 -13
- data/lib/omnibus/cli/changelog.rb +8 -9
- data/lib/omnibus/cli/publish.rb +12 -13
- data/lib/omnibus/cli.rb +26 -27
- data/lib/omnibus/compressor.rb +6 -6
- data/lib/omnibus/compressors/base.rb +7 -2
- data/lib/omnibus/compressors/dmg.rb +12 -12
- data/lib/omnibus/compressors/null.rb +1 -1
- data/lib/omnibus/compressors/tgz.rb +8 -8
- data/lib/omnibus/config.rb +37 -26
- data/lib/omnibus/core_extensions/open_uri.rb +3 -3
- data/lib/omnibus/core_extensions.rb +1 -1
- data/lib/omnibus/digestable.rb +5 -4
- data/lib/omnibus/download_helpers.rb +7 -6
- data/lib/omnibus/exceptions.rb +29 -13
- data/lib/omnibus/fetcher.rb +0 -1
- data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
- data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
- data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
- data/lib/omnibus/file_syncer.rb +3 -3
- data/lib/omnibus/generator.rb +60 -47
- data/lib/omnibus/git_cache.rb +33 -22
- data/lib/omnibus/git_repository.rb +5 -5
- data/lib/omnibus/health_check.rb +122 -119
- data/lib/omnibus/instrumentation.rb +1 -1
- data/lib/omnibus/licensing.rb +348 -60
- data/lib/omnibus/logger.rb +12 -9
- data/lib/omnibus/logging.rb +1 -1
- data/lib/omnibus/manifest.rb +4 -4
- data/lib/omnibus/manifest_diff.rb +6 -7
- data/lib/omnibus/manifest_entry.rb +1 -1
- data/lib/omnibus/metadata.rb +36 -36
- data/lib/omnibus/ohai.rb +6 -7
- data/lib/omnibus/package.rb +1 -1
- data/lib/omnibus/packager.rb +37 -28
- data/lib/omnibus/packagers/appx.rb +86 -0
- data/lib/omnibus/packagers/base.rb +21 -18
- data/lib/omnibus/packagers/bff.rb +22 -24
- data/lib/omnibus/packagers/deb.rb +20 -20
- data/lib/omnibus/packagers/ips.rb +18 -17
- data/lib/omnibus/packagers/makeself.rb +7 -7
- data/lib/omnibus/packagers/msi.rb +38 -193
- data/lib/omnibus/packagers/pkg.rb +16 -16
- data/lib/omnibus/packagers/rpm.rb +53 -54
- data/lib/omnibus/packagers/solaris.rb +14 -14
- data/lib/omnibus/packagers/windows_base.rb +192 -0
- data/lib/omnibus/project.rb +45 -43
- data/lib/omnibus/publisher.rb +3 -3
- data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
- data/lib/omnibus/publishers/s3_publisher.rb +7 -7
- data/lib/omnibus/reports.rb +10 -10
- data/lib/omnibus/s3_cache.rb +7 -7
- data/lib/omnibus/s3_helpers.rb +8 -7
- data/lib/omnibus/semantic_version.rb +1 -1
- data/lib/omnibus/software.rb +131 -81
- data/lib/omnibus/sugarable.rb +10 -10
- data/lib/omnibus/templating.rb +5 -5
- data/lib/omnibus/thread_pool.rb +1 -1
- data/lib/omnibus/util.rb +5 -5
- data/lib/omnibus/version.rb +1 -1
- data/lib/omnibus.rb +65 -65
- data/omnibus.gemspec +34 -32
- data/resources/appx/AppxManifest.xml.erb +18 -0
- data/resources/appx/assets/clear.png +0 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
- data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
- data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
- data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
- data/spec/functional/builder_spec.rb +149 -150
- data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
- data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
- data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
- data/spec/functional/file_syncer_spec.rb +74 -74
- data/spec/functional/licensing_spec.rb +344 -35
- data/spec/functional/templating_spec.rb +17 -17
- data/spec/spec_helper.rb +20 -20
- data/spec/support/examples.rb +21 -15
- data/spec/support/file_helpers.rb +1 -1
- data/spec/support/git_helpers.rb +37 -37
- data/spec/support/matchers.rb +3 -3
- data/spec/support/ohai_helpers.rb +4 -4
- data/spec/support/path_helpers.rb +2 -2
- data/spec/support/shell_helpers.rb +2 -2
- data/spec/unit/build_version_dsl_spec.rb +5 -5
- data/spec/unit/build_version_spec.rb +63 -63
- data/spec/unit/builder_spec.rb +86 -70
- data/spec/unit/changelog_spec.rb +4 -4
- data/spec/unit/changelogprinter_spec.rb +130 -0
- data/spec/unit/cleanroom_spec.rb +11 -11
- data/spec/unit/compressor_spec.rb +16 -16
- data/spec/unit/compressors/base_spec.rb +6 -6
- data/spec/unit/compressors/dmg_spec.rb +76 -76
- data/spec/unit/compressors/null_spec.rb +4 -4
- data/spec/unit/compressors/tgz_spec.rb +20 -20
- data/spec/unit/config_spec.rb +44 -43
- data/spec/unit/digestable_spec.rb +13 -13
- data/spec/unit/fetcher_spec.rb +11 -12
- data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
- data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
- data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
- data/spec/unit/generator_spec.rb +38 -38
- data/spec/unit/git_cache_spec.rb +56 -54
- data/spec/unit/git_repository_spec.rb +2 -2
- data/spec/unit/health_check_spec.rb +40 -40
- data/spec/unit/library_spec.rb +35 -35
- data/spec/unit/manifest_diff_spec.rb +10 -11
- data/spec/unit/manifest_spec.rb +17 -17
- data/spec/unit/metadata_spec.rb +152 -152
- data/spec/unit/ohai_spec.rb +5 -5
- data/spec/unit/omnibus_spec.rb +31 -31
- data/spec/unit/package_spec.rb +20 -20
- data/spec/unit/packager_spec.rb +48 -42
- data/spec/unit/packagers/appx_spec.rb +165 -0
- data/spec/unit/packagers/base_spec.rb +34 -34
- data/spec/unit/packagers/bff_spec.rb +60 -60
- data/spec/unit/packagers/deb_spec.rb +71 -71
- data/spec/unit/packagers/ips_spec.rb +45 -45
- data/spec/unit/packagers/makeself_spec.rb +22 -22
- data/spec/unit/packagers/msi_spec.rb +141 -147
- data/spec/unit/packagers/pkg_spec.rb +59 -60
- data/spec/unit/packagers/rpm_spec.rb +125 -126
- data/spec/unit/packagers/solaris_spec.rb +52 -52
- data/spec/unit/project_spec.rb +137 -135
- data/spec/unit/publisher_spec.rb +70 -70
- data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
- data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
- data/spec/unit/s3_cacher_spec.rb +34 -34
- data/spec/unit/s3_helpers_spec.rb +6 -6
- data/spec/unit/semantic_version_spec.rb +2 -2
- data/spec/unit/software_spec.rb +346 -384
- data/spec/unit/sugarable_spec.rb +10 -10
- data/spec/unit/util_spec.rb +60 -60
- metadata +54 -6
- data/.rubocop.yml +0 -48
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Omnibus
|
4
4
|
describe PathFetcher do
|
5
|
-
include_examples
|
5
|
+
include_examples "a software"
|
6
6
|
|
7
|
-
let(:source_path) { File.join(tmp_path,
|
7
|
+
let(:source_path) { File.join(tmp_path, "remote", "software") }
|
8
8
|
|
9
9
|
let(:source) do
|
10
10
|
{ path: source_path }
|
@@ -12,7 +12,7 @@ module Omnibus
|
|
12
12
|
|
13
13
|
let(:manifest_entry) do
|
14
14
|
double(Omnibus::ManifestEntry,
|
15
|
-
name:
|
15
|
+
name: "pathelogical",
|
16
16
|
locked_version: nil,
|
17
17
|
described_version: nil,
|
18
18
|
locked_source: source)
|
@@ -24,33 +24,32 @@ module Omnibus
|
|
24
24
|
|
25
25
|
subject { described_class.new(manifest_entry, project_dir, build_dir) }
|
26
26
|
|
27
|
-
|
28
27
|
describe '#fetch_required?' do
|
29
|
-
context
|
28
|
+
context "when the directories have different files" do
|
30
29
|
before do
|
31
|
-
create_file("#{source_path}/directory/file") {
|
32
|
-
create_file("#{project_dir}/directory/file") {
|
30
|
+
create_file("#{source_path}/directory/file") { "different" }
|
31
|
+
create_file("#{project_dir}/directory/file") { "same" }
|
33
32
|
end
|
34
33
|
|
35
|
-
it
|
34
|
+
it "return true" do
|
36
35
|
expect(subject.fetch_required?).to be_truthy
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
40
|
-
context
|
39
|
+
context "when the directories have the same files" do
|
41
40
|
before do
|
42
|
-
create_file("#{source_path}/directory/file") {
|
43
|
-
create_file("#{project_dir}/directory/file") {
|
41
|
+
create_file("#{source_path}/directory/file") { "same" }
|
42
|
+
create_file("#{project_dir}/directory/file") { "same" }
|
44
43
|
end
|
45
44
|
|
46
|
-
it
|
45
|
+
it "returns false" do
|
47
46
|
expect(subject.fetch_required?).to be(false)
|
48
47
|
end
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
52
51
|
describe '#version_guid' do
|
53
|
-
it
|
52
|
+
it "includes the source path" do
|
54
53
|
expect(subject.version_guid).to eq("path:#{source_path}")
|
55
54
|
end
|
56
55
|
end
|
@@ -68,7 +67,7 @@ module Omnibus
|
|
68
67
|
create_file("#{project_dir}/file_d")
|
69
68
|
end
|
70
69
|
|
71
|
-
it
|
70
|
+
it "fetches new files" do
|
72
71
|
subject.fetch
|
73
72
|
|
74
73
|
expect("#{project_dir}/file_a").to be_a_file
|
@@ -76,7 +75,7 @@ module Omnibus
|
|
76
75
|
expect("#{project_dir}/.file_c").to be_a_file
|
77
76
|
end
|
78
77
|
|
79
|
-
it
|
78
|
+
it "removes extraneous files" do
|
80
79
|
subject.fetch
|
81
80
|
|
82
81
|
expect("#{project_dir}/file_d").to_not be_a_file
|
@@ -84,7 +83,7 @@ module Omnibus
|
|
84
83
|
end
|
85
84
|
|
86
85
|
describe '#clean' do
|
87
|
-
it
|
86
|
+
it "returns true" do
|
88
87
|
expect(subject.clean).to be_truthy
|
89
88
|
end
|
90
89
|
end
|
@@ -96,15 +95,15 @@ module Omnibus
|
|
96
95
|
create_file("#{source_path}/.file_c")
|
97
96
|
end
|
98
97
|
|
99
|
-
let(:sha) {
|
98
|
+
let(:sha) { "69553b23b84e69e095b4a231877b38022b1ffb41ae0ecbba6bb2625410c49f7e" }
|
100
99
|
|
101
|
-
it
|
100
|
+
it "includes the source_path and shasum" do
|
102
101
|
expect(subject.version_for_cache).to eq("path:#{source_path}|shasum:#{sha}")
|
103
102
|
end
|
104
103
|
end
|
105
104
|
|
106
105
|
describe '#resolve_version' do
|
107
|
-
it
|
106
|
+
it "just returns the version" do
|
108
107
|
expect(NetFetcher.resolve_version("1.2.3", source)).to eq("1.2.3")
|
109
108
|
end
|
110
109
|
end
|
@@ -1,68 +1,68 @@
|
|
1
|
-
require
|
1
|
+
require "spec_helper"
|
2
2
|
|
3
3
|
module Omnibus
|
4
4
|
describe FileSyncer do
|
5
5
|
describe '#glob' do
|
6
6
|
before do
|
7
|
-
FileUtils.mkdir_p(File.join(tmp_path,
|
8
|
-
FileUtils.mkdir_p(File.join(tmp_path,
|
7
|
+
FileUtils.mkdir_p(File.join(tmp_path, "folder"))
|
8
|
+
FileUtils.mkdir_p(File.join(tmp_path, ".hidden_folder"))
|
9
9
|
|
10
|
-
FileUtils.touch(File.join(tmp_path,
|
11
|
-
FileUtils.touch(File.join(tmp_path,
|
10
|
+
FileUtils.touch(File.join(tmp_path, "folder", "file"))
|
11
|
+
FileUtils.touch(File.join(tmp_path, ".hidden_file"))
|
12
12
|
end
|
13
13
|
|
14
14
|
let(:list) do
|
15
15
|
described_class
|
16
16
|
.glob("#{tmp_path}/**/*")
|
17
|
-
.map { |item| item.sub("#{tmp_path}/",
|
17
|
+
.map { |item| item.sub("#{tmp_path}/", "") }
|
18
18
|
end
|
19
19
|
|
20
|
-
it
|
21
|
-
expect(list).to include(
|
22
|
-
expect(list).to include(
|
20
|
+
it "includes regular files" do
|
21
|
+
expect(list).to include("folder")
|
22
|
+
expect(list).to include("folder/file")
|
23
23
|
end
|
24
24
|
|
25
|
-
it
|
26
|
-
expect(list).to_not include(
|
25
|
+
it "ignores ." do
|
26
|
+
expect(list).to_not include(".")
|
27
27
|
end
|
28
28
|
|
29
|
-
it
|
30
|
-
expect(list).to_not include(
|
29
|
+
it "ignores .." do
|
30
|
+
expect(list).to_not include("..")
|
31
31
|
end
|
32
32
|
|
33
|
-
it
|
34
|
-
expect(list).to include(
|
33
|
+
it "includes hidden files" do
|
34
|
+
expect(list).to include(".hidden_file")
|
35
35
|
end
|
36
36
|
|
37
|
-
it
|
38
|
-
expect(list).to include(
|
37
|
+
it "includes hidden folders" do
|
38
|
+
expect(list).to include(".hidden_folder")
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
42
|
describe '#sync' do
|
43
43
|
let(:source) do
|
44
|
-
source = File.join(tmp_path,
|
44
|
+
source = File.join(tmp_path, "source")
|
45
45
|
FileUtils.mkdir_p(source)
|
46
46
|
|
47
|
-
FileUtils.touch(File.join(source,
|
48
|
-
FileUtils.touch(File.join(source,
|
49
|
-
FileUtils.touch(File.join(source,
|
47
|
+
FileUtils.touch(File.join(source, "file_a"))
|
48
|
+
FileUtils.touch(File.join(source, "file_b"))
|
49
|
+
FileUtils.touch(File.join(source, "file_c"))
|
50
50
|
|
51
|
-
FileUtils.mkdir_p(File.join(source,
|
52
|
-
FileUtils.touch(File.join(source,
|
53
|
-
FileUtils.touch(File.join(source,
|
51
|
+
FileUtils.mkdir_p(File.join(source, "folder"))
|
52
|
+
FileUtils.touch(File.join(source, "folder", "file_d"))
|
53
|
+
FileUtils.touch(File.join(source, "folder", "file_e"))
|
54
54
|
|
55
|
-
FileUtils.mkdir_p(File.join(source,
|
56
|
-
FileUtils.touch(File.join(source,
|
55
|
+
FileUtils.mkdir_p(File.join(source, ".dot_folder"))
|
56
|
+
FileUtils.touch(File.join(source, ".dot_folder", "file_f"))
|
57
57
|
|
58
|
-
FileUtils.touch(File.join(source,
|
58
|
+
FileUtils.touch(File.join(source, ".file_g"))
|
59
59
|
source
|
60
60
|
end
|
61
61
|
|
62
|
-
let(:destination) { File.join(tmp_path,
|
62
|
+
let(:destination) { File.join(tmp_path, "destination") }
|
63
63
|
|
64
|
-
context
|
65
|
-
it
|
64
|
+
context "when the destination is empty" do
|
65
|
+
it "syncs the directories" do
|
66
66
|
described_class.sync(source, destination)
|
67
67
|
|
68
68
|
expect("#{destination}/file_a").to be_a_file
|
@@ -75,34 +75,34 @@ module Omnibus
|
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
78
|
-
context
|
78
|
+
context "when destination file exists" do
|
79
79
|
|
80
80
|
let(:source) {
|
81
|
-
s = File.join(tmp_path,
|
81
|
+
s = File.join(tmp_path, "source")
|
82
82
|
FileUtils.mkdir_p(s)
|
83
|
-
p = create_file(s,
|
83
|
+
p = create_file(s, "read-only-file") { "new" }
|
84
84
|
FileUtils.chmod(0400, p)
|
85
85
|
s
|
86
86
|
}
|
87
87
|
|
88
88
|
let(:destination) {
|
89
|
-
dest = File.join(tmp_path,
|
89
|
+
dest = File.join(tmp_path, "destination")
|
90
90
|
FileUtils.mkdir_p(dest)
|
91
|
-
create_file(dest,
|
92
|
-
FileUtils.chmod(0400, File.join(dest,
|
91
|
+
create_file(dest, "read-only-file") { "old" }
|
92
|
+
FileUtils.chmod(0400, File.join(dest, "read-only-file"))
|
93
93
|
dest
|
94
94
|
}
|
95
95
|
|
96
|
-
it
|
96
|
+
it "copies over a read-only file" do
|
97
97
|
described_class.sync(source, destination)
|
98
98
|
expect("#{destination}/read-only-file").to have_content "new"
|
99
99
|
end
|
100
100
|
end
|
101
101
|
|
102
|
-
context
|
102
|
+
context "when the directory exists" do
|
103
103
|
before { FileUtils.mkdir_p(destination) }
|
104
104
|
|
105
|
-
it
|
105
|
+
it "deletes existing files and folders" do
|
106
106
|
FileUtils.mkdir_p("#{destination}/existing_folder")
|
107
107
|
FileUtils.mkdir_p("#{destination}/.existing_folder")
|
108
108
|
FileUtils.touch("#{destination}/existing_file")
|
@@ -125,20 +125,20 @@ module Omnibus
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
-
context
|
128
|
+
context "when target files are hard links" do
|
129
129
|
let(:source) do
|
130
|
-
source = File.join(tmp_path,
|
130
|
+
source = File.join(tmp_path, "source")
|
131
131
|
FileUtils.mkdir_p(source)
|
132
132
|
|
133
|
-
create_directory(source,
|
134
|
-
|
135
|
-
|
136
|
-
|
133
|
+
create_directory(source, "bin")
|
134
|
+
create_file(source, "bin", "git")
|
135
|
+
FileUtils.ln("#{source}/bin/git", "#{source}/bin/git-tag")
|
136
|
+
FileUtils.ln("#{source}/bin/git", "#{source}/bin/git-write-tree")
|
137
137
|
|
138
138
|
source
|
139
139
|
end
|
140
140
|
|
141
|
-
it
|
141
|
+
it "copies the first instance and links to that instance thereafter" do
|
142
142
|
FileUtils.mkdir_p("#{destination}/bin")
|
143
143
|
|
144
144
|
described_class.sync(source, destination)
|
@@ -154,41 +154,41 @@ module Omnibus
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
-
context
|
157
|
+
context "with deeply nested paths and symlinks", :not_supported_on_windows do
|
158
158
|
let(:source) do
|
159
|
-
source = File.join(tmp_path,
|
159
|
+
source = File.join(tmp_path, "source")
|
160
160
|
FileUtils.mkdir_p(source)
|
161
161
|
|
162
|
-
create_directory(source,
|
163
|
-
|
164
|
-
|
162
|
+
create_directory(source, "bin")
|
163
|
+
create_file(source, "bin", "apt")
|
164
|
+
create_file(source, "bin", "yum")
|
165
165
|
|
166
|
-
create_file(source,
|
166
|
+
create_file(source, "LICENSE") { "MIT" }
|
167
167
|
|
168
|
-
create_directory(source,
|
169
|
-
create_directory(source,
|
170
|
-
|
168
|
+
create_directory(source, "include")
|
169
|
+
create_directory(source, "include", "linux")
|
170
|
+
create_file(source, "include", "linux", "init.ini")
|
171
171
|
|
172
|
-
create_directory(source,
|
173
|
-
create_directory(source,
|
174
|
-
|
175
|
-
|
176
|
-
|
172
|
+
create_directory(source, "source")
|
173
|
+
create_directory(source, "source", "bin")
|
174
|
+
create_file(source, "source", "bin", "apt")
|
175
|
+
create_file(source, "source", "bin", "yum")
|
176
|
+
create_file(source, "source", "LICENSE") { "Apache 2.0" }
|
177
177
|
|
178
|
-
create_directory(source,
|
178
|
+
create_directory(source, "empty_directory")
|
179
179
|
|
180
|
-
create_directory(source,
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
180
|
+
create_directory(source, "links")
|
181
|
+
create_file(source, "links", "home.html")
|
182
|
+
FileUtils.ln_s("./home.html", "#{source}/links/index.html")
|
183
|
+
FileUtils.ln_s("./home.html", "#{source}/links/default.html")
|
184
|
+
FileUtils.ln_s("../source/bin/apt", "#{source}/links/apt")
|
185
185
|
|
186
|
-
FileUtils.ln_s(
|
186
|
+
FileUtils.ln_s("/foo/bar", "#{source}/root")
|
187
187
|
|
188
188
|
source
|
189
189
|
end
|
190
190
|
|
191
|
-
it
|
191
|
+
it "copies relative and absolute symlinks" do
|
192
192
|
described_class.sync(source, destination)
|
193
193
|
|
194
194
|
expect("#{destination}/bin").to be_a_directory
|
@@ -215,13 +215,13 @@ module Omnibus
|
|
215
215
|
expect("#{destination}/links/default.html").to be_a_symlink_to("./home.html")
|
216
216
|
expect("#{destination}/links/apt").to be_a_symlink_to("../source/bin/apt")
|
217
217
|
|
218
|
-
expect("#{destination}/root").to be_a_symlink_to(
|
218
|
+
expect("#{destination}/root").to be_a_symlink_to("/foo/bar")
|
219
219
|
end
|
220
220
|
end
|
221
221
|
|
222
|
-
context
|
223
|
-
it
|
224
|
-
described_class.sync(source, destination, exclude:
|
222
|
+
context "when :exclude is given" do
|
223
|
+
it "does not copy files and folders that match the pattern" do
|
224
|
+
described_class.sync(source, destination, exclude: ".dot_folder")
|
225
225
|
|
226
226
|
expect("#{destination}/file_a").to be_a_file
|
227
227
|
expect("#{destination}/file_b").to be_a_file
|
@@ -233,13 +233,13 @@ module Omnibus
|
|
233
233
|
expect("#{destination}/.file_g").to be_a_file
|
234
234
|
end
|
235
235
|
|
236
|
-
it
|
236
|
+
it "removes existing files and folders in destination" do
|
237
237
|
FileUtils.mkdir_p("#{destination}/existing_folder")
|
238
238
|
FileUtils.touch("#{destination}/existing_file")
|
239
239
|
FileUtils.mkdir_p("#{destination}/.dot_folder")
|
240
240
|
FileUtils.touch("#{destination}/.dot_folder/file_f")
|
241
241
|
|
242
|
-
described_class.sync(source, destination, exclude:
|
242
|
+
described_class.sync(source, destination, exclude: ".dot_folder")
|
243
243
|
|
244
244
|
expect("#{destination}/file_a").to be_a_file
|
245
245
|
expect("#{destination}/file_b").to be_a_file
|