braid 1.1.6 → 1.1.7
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 +4 -4
- data/exe/braid +11 -0
- data/lib/braid/check_gem.rb +58 -0
- data/lib/braid/command.rb +13 -0
- data/lib/braid/commands/diff.rb +1 -1
- data/lib/braid/config.rb +28 -4
- data/{bin/braid → lib/braid/main.rb} +1 -16
- data/lib/braid/mirror.rb +110 -23
- data/lib/braid/operations.rb +5 -4
- data/lib/braid/operations_lite.rb +19 -1
- data/lib/braid/sorbet/fake_runtime.rb +68 -0
- data/lib/braid/sorbet/setup.rb +18 -0
- data/lib/braid/version.rb +1 -1
- data/lib/braid.rb +21 -0
- metadata +12 -75
- data/.gitignore +0 -16
- data/.travis.yml +0 -15
- data/CONTRIBUTING.md +0 -24
- data/Gemfile +0 -3
- data/README.md +0 -234
- data/Rakefile +0 -12
- data/_config.yml +0 -1
- data/braid.gemspec +0 -35
- data/braids-json.schema.json +0 -91
- data/config_versions.md +0 -58
- data/spec/config_spec.rb +0 -59
- data/spec/fixtures/shiny/README +0 -3
- data/spec/fixtures/shiny/other-skit/layout.liquid +0 -219
- data/spec/fixtures/shiny/skit-layout.liquid.test +0 -2
- data/spec/fixtures/shiny/skit1.test +0 -2
- data/spec/fixtures/shiny-conf-1.0.9-lock/.braids.json +0 -10
- data/spec/fixtures/shiny-conf-1.0.9-lock/expected.braids.json +0 -9
- data/spec/fixtures/shiny-conf-1.0.9-lock/skit1/layouts/layout.liquid +0 -219
- data/spec/fixtures/shiny-conf-1.0.9-lock/skit1/preview.png +0 -0
- data/spec/fixtures/shiny-conf-breaking-changes/.braids +0 -14
- data/spec/fixtures/shiny-conf-breaking-changes/Spoon-Knife/README.md +0 -9
- data/spec/fixtures/shiny-conf-breaking-changes/Spoon-Knife/index.html +0 -20
- data/spec/fixtures/shiny-conf-breaking-changes/Spoon-Knife/styles.css +0 -17
- data/spec/fixtures/shiny-conf-breaking-changes/expected.braids.json +0 -10
- data/spec/fixtures/shiny-conf-breaking-changes/skit1/layouts/layout.liquid +0 -219
- data/spec/fixtures/shiny-conf-breaking-changes/skit1/preview.png +0 -0
- data/spec/fixtures/shiny-conf-future/.braids.json +0 -10
- data/spec/fixtures/shiny-conf-future/skit1/layouts/layout.liquid +0 -219
- data/spec/fixtures/shiny-conf-future/skit1/preview.png +0 -0
- data/spec/fixtures/shiny-conf-json-old-name/.braids +0 -9
- data/spec/fixtures/shiny-conf-json-old-name/expected.braids.json +0 -10
- data/spec/fixtures/shiny-conf-json-old-name/skit1/layouts/layout.liquid +0 -219
- data/spec/fixtures/shiny-conf-json-old-name/skit1/preview.png +0 -0
- data/spec/fixtures/shiny-conf-yaml/.braids +0 -8
- data/spec/fixtures/shiny-conf-yaml/expected.braids.json +0 -10
- data/spec/fixtures/shiny-conf-yaml/skit1/layouts/layout.liquid +0 -219
- data/spec/fixtures/shiny-conf-yaml/skit1/preview.png +0 -0
- data/spec/fixtures/shiny_skit1.2_merged/layouts/layout.liquid +0 -223
- data/spec/fixtures/shiny_skit1.2_merged/preview.png +0 -0
- data/spec/fixtures/shiny_skit1_conflicting/layouts/layout.liquid +0 -221
- data/spec/fixtures/shiny_skit1_conflicting/preview.png +0 -0
- data/spec/fixtures/shiny_skit1_mergeable/layouts/layout.liquid +0 -221
- data/spec/fixtures/shiny_skit1_mergeable/preview.png +0 -0
- data/spec/fixtures/skit1/layouts/layout.liquid +0 -219
- data/spec/fixtures/skit1/preview.png +0 -0
- data/spec/fixtures/skit1.1/layouts/layout.liquid +0 -219
- data/spec/fixtures/skit1.1_with_filter/.gitattributes +0 -1
- data/spec/fixtures/skit1.1_with_filter/layouts/layout.liquid +0 -219
- data/spec/fixtures/skit1.1_with_filter/preview.png +0 -0
- data/spec/fixtures/skit1.1x/layouts/layout.liquid +0 -219
- data/spec/fixtures/skit1.2/layouts/layout.liquid +0 -221
- data/spec/fixtures/skit1.3/layouts/README.md +0 -1
- data/spec/fixtures/skit1.3/layouts/layout.liquid +0 -221
- data/spec/fixtures/skit1_with_filter/.gitattributes +0 -1
- data/spec/fixtures/skit1_with_filter/layouts/layout.liquid +0 -219
- data/spec/fixtures/skit1_with_filter/preview.png +0 -0
- data/spec/integration/adding_spec.rb +0 -230
- data/spec/integration/config_versioning_spec.rb +0 -222
- data/spec/integration/diff_spec.rb +0 -597
- data/spec/integration/integration_helper.rb +0 -129
- data/spec/integration/push_spec.rb +0 -399
- data/spec/integration/remove_spec.rb +0 -81
- data/spec/integration/status_spec.rb +0 -165
- data/spec/integration/updating_spec.rb +0 -487
- data/spec/mirror_spec.rb +0 -119
- data/spec/operations_spec.rb +0 -66
- data/spec/test_helper.rb +0 -19
@@ -1,597 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/integration_helper'
|
2
|
-
|
3
|
-
describe 'Running braid diff with a mirror' do
|
4
|
-
before do
|
5
|
-
FileUtils.rm_rf(TMP_PATH)
|
6
|
-
FileUtils.mkdir_p(TMP_PATH)
|
7
|
-
@repository_dir = create_git_repo_from_fixture('shiny')
|
8
|
-
@vendor_repository_dir = create_git_repo_from_fixture('skit1')
|
9
|
-
in_dir(@vendor_repository_dir) do
|
10
|
-
run_command('git tag v1')
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
describe 'braided directly in' do
|
15
|
-
before do
|
16
|
-
in_dir(@repository_dir) do
|
17
|
-
run_command("#{BRAID_BIN} add #{@vendor_repository_dir}")
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe 'with no changes' do
|
22
|
-
it 'with the mirror specified should emit no output' do
|
23
|
-
diff = nil
|
24
|
-
in_dir(@repository_dir) do
|
25
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
26
|
-
end
|
27
|
-
|
28
|
-
expect(diff).to eq('')
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'without specifying a mirror should emit only banners' do
|
32
|
-
diff = nil
|
33
|
-
in_dir(@repository_dir) do
|
34
|
-
diff = run_command("#{BRAID_BIN} diff")
|
35
|
-
end
|
36
|
-
|
37
|
-
expect(diff).to eq("=======================================================\nBraid: Diffing skit1\n=======================================================\n")
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe 'with changes' do
|
42
|
-
before do
|
43
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1') + '/.', "#{@repository_dir}/skit1")
|
44
|
-
in_dir(@repository_dir) do
|
45
|
-
run_command('git add *')
|
46
|
-
run_command('git commit -m "Some local changes"')
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
EXPECTED_DIFF=<<PATCH
|
51
|
-
diff --git a/layouts/layout.liquid b/layouts/layout.liquid
|
52
|
-
index 9f75009..25a4b32 100644
|
53
|
-
--- a/layouts/layout.liquid
|
54
|
-
+++ b/layouts/layout.liquid
|
55
|
-
@@ -22,7 +22,7 @@
|
56
|
-
<![endif]-->
|
57
|
-
</head>
|
58
|
-
|
59
|
-
-<body class="fixed orange">
|
60
|
-
+<body class="fixed green">
|
61
|
-
<script type="text/javascript">loadPreferences()</script>
|
62
|
-
|
63
|
-
<div id="wrapper">
|
64
|
-
PATCH
|
65
|
-
|
66
|
-
it 'with the mirror specified should emit diff' do
|
67
|
-
diff = nil
|
68
|
-
in_dir(@repository_dir) do
|
69
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
70
|
-
end
|
71
|
-
|
72
|
-
expect(diff).to eq(EXPECTED_DIFF)
|
73
|
-
end
|
74
|
-
|
75
|
-
it 'without specifying a mirror should emit diff and banners' do
|
76
|
-
diff = nil
|
77
|
-
in_dir(@repository_dir) do
|
78
|
-
diff = run_command("#{BRAID_BIN} diff")
|
79
|
-
end
|
80
|
-
|
81
|
-
expect(diff).to eq(<<BANNER + EXPECTED_DIFF)
|
82
|
-
=======================================================
|
83
|
-
Braid: Diffing skit1
|
84
|
-
=======================================================
|
85
|
-
BANNER
|
86
|
-
end
|
87
|
-
|
88
|
-
it 'in a new clone of the downstream repository should fetch the base revision and emit diff' do
|
89
|
-
diff = nil
|
90
|
-
CLONE_NAME = 'shiny-clone'
|
91
|
-
in_dir(TMP_PATH) do
|
92
|
-
run_command("git clone --quiet #{@repository_dir} #{CLONE_NAME}")
|
93
|
-
end
|
94
|
-
clone_dir = File.join(TMP_PATH, CLONE_NAME)
|
95
|
-
in_dir(clone_dir) do
|
96
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
97
|
-
end
|
98
|
-
|
99
|
-
expect(diff).to eq(EXPECTED_DIFF)
|
100
|
-
end
|
101
|
-
|
102
|
-
it 'after pruning the base revision from the repository should fetch it again and emit diff' do
|
103
|
-
# Note: It is not the intent of this test case to require that Braid
|
104
|
-
# leave objects from the mirror in the main repository after it exits.
|
105
|
-
# A design change to stop doing that would legitimately require this
|
106
|
-
# test case to be modified or dropped.
|
107
|
-
diff = nil
|
108
|
-
in_dir(@repository_dir) do
|
109
|
-
status_out = run_command("#{BRAID_BIN} status skit1")
|
110
|
-
base_revision = /^skit1 \(([0-9a-f]{40})\)/.match(status_out)[1]
|
111
|
-
# Make sure the base revision is in the repository as a sanity check.
|
112
|
-
run_command("git rev-parse --verify --quiet #{base_revision}^{commit}")
|
113
|
-
run_command('git gc --quiet --prune=all')
|
114
|
-
# Make sure it's gone now so we know we're actually testing Braid's fetch behavior.
|
115
|
-
run_command_expect_failure("git rev-parse --verify --quiet #{base_revision}^{commit}")
|
116
|
-
|
117
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
118
|
-
|
119
|
-
# The base revision should be present again.
|
120
|
-
run_command("git rev-parse --verify --quiet #{base_revision}^{commit}")
|
121
|
-
end
|
122
|
-
|
123
|
-
expect(diff).to eq(EXPECTED_DIFF)
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
describe 'with uncommitted changes (some staged)' do
|
128
|
-
before do
|
129
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1') + '/.', "#{@repository_dir}/skit1")
|
130
|
-
in_dir(@repository_dir) do
|
131
|
-
run_command('git add *')
|
132
|
-
end
|
133
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.2') + '/.', "#{@repository_dir}/skit1")
|
134
|
-
# Now "orange" -> "green" is staged, "Happy boxying!" is unstaged.
|
135
|
-
end
|
136
|
-
|
137
|
-
it 'with the mirror specified should show all uncommitted changes' do
|
138
|
-
diff = nil
|
139
|
-
in_dir(@repository_dir) do
|
140
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
141
|
-
end
|
142
|
-
|
143
|
-
expect(diff).to eq(<<PATCH)
|
144
|
-
diff --git a/layouts/layout.liquid b/layouts/layout.liquid
|
145
|
-
index 9f75009..7037e21 100644
|
146
|
-
--- a/layouts/layout.liquid
|
147
|
-
+++ b/layouts/layout.liquid
|
148
|
-
@@ -22,7 +22,7 @@
|
149
|
-
<![endif]-->
|
150
|
-
</head>
|
151
|
-
|
152
|
-
-<body class="fixed orange">
|
153
|
-
+<body class="fixed green">
|
154
|
-
<script type="text/javascript">loadPreferences()</script>
|
155
|
-
|
156
|
-
<div id="wrapper">
|
157
|
-
@@ -81,6 +81,8 @@
|
158
|
-
|
159
|
-
<p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
|
160
|
-
|
161
|
-
+<p>Happy boxying!</p>
|
162
|
-
+
|
163
|
-
</div>
|
164
|
-
|
165
|
-
<div id="search" class="boxy short">
|
166
|
-
PATCH
|
167
|
-
end
|
168
|
-
|
169
|
-
it 'without specifying a mirror should show all uncommitted changes with a banner' do
|
170
|
-
diff = nil
|
171
|
-
in_dir(@repository_dir) do
|
172
|
-
diff = run_command("#{BRAID_BIN} diff")
|
173
|
-
end
|
174
|
-
|
175
|
-
expect(diff).to eq(<<PATCH)
|
176
|
-
=======================================================
|
177
|
-
Braid: Diffing skit1
|
178
|
-
=======================================================
|
179
|
-
diff --git a/layouts/layout.liquid b/layouts/layout.liquid
|
180
|
-
index 9f75009..7037e21 100644
|
181
|
-
--- a/layouts/layout.liquid
|
182
|
-
+++ b/layouts/layout.liquid
|
183
|
-
@@ -22,7 +22,7 @@
|
184
|
-
<![endif]-->
|
185
|
-
</head>
|
186
|
-
|
187
|
-
-<body class="fixed orange">
|
188
|
-
+<body class="fixed green">
|
189
|
-
<script type="text/javascript">loadPreferences()</script>
|
190
|
-
|
191
|
-
<div id="wrapper">
|
192
|
-
@@ -81,6 +81,8 @@
|
193
|
-
|
194
|
-
<p>Have boxes with smaller text with the class "minor". See the "Recent" boxy below.</p>
|
195
|
-
|
196
|
-
+<p>Happy boxying!</p>
|
197
|
-
+
|
198
|
-
</div>
|
199
|
-
|
200
|
-
<div id="search" class="boxy short">
|
201
|
-
PATCH
|
202
|
-
end
|
203
|
-
|
204
|
-
it 'with the mirror specified and --cached should show only the staged uncommitted changes' do
|
205
|
-
diff = nil
|
206
|
-
in_dir(@repository_dir) do
|
207
|
-
diff = run_command("#{BRAID_BIN} diff skit1 -- --cached")
|
208
|
-
end
|
209
|
-
|
210
|
-
expect(diff).to eq(<<PATCH)
|
211
|
-
diff --git a/layouts/layout.liquid b/layouts/layout.liquid
|
212
|
-
index 9f75009..25a4b32 100644
|
213
|
-
--- a/layouts/layout.liquid
|
214
|
-
+++ b/layouts/layout.liquid
|
215
|
-
@@ -22,7 +22,7 @@
|
216
|
-
<![endif]-->
|
217
|
-
</head>
|
218
|
-
|
219
|
-
-<body class="fixed orange">
|
220
|
-
+<body class="fixed green">
|
221
|
-
<script type="text/javascript">loadPreferences()</script>
|
222
|
-
|
223
|
-
<div id="wrapper">
|
224
|
-
PATCH
|
225
|
-
end
|
226
|
-
|
227
|
-
it 'without specifying a mirror and with --cached should show only the staged uncommitted changes with a banner' do
|
228
|
-
diff = nil
|
229
|
-
in_dir(@repository_dir) do
|
230
|
-
diff = run_command("#{BRAID_BIN} diff -- --cached")
|
231
|
-
end
|
232
|
-
|
233
|
-
expect(diff).to eq(<<PATCH)
|
234
|
-
=======================================================
|
235
|
-
Braid: Diffing skit1
|
236
|
-
=======================================================
|
237
|
-
diff --git a/layouts/layout.liquid b/layouts/layout.liquid
|
238
|
-
index 9f75009..25a4b32 100644
|
239
|
-
--- a/layouts/layout.liquid
|
240
|
-
+++ b/layouts/layout.liquid
|
241
|
-
@@ -22,7 +22,7 @@
|
242
|
-
<![endif]-->
|
243
|
-
</head>
|
244
|
-
|
245
|
-
-<body class="fixed orange">
|
246
|
-
+<body class="fixed green">
|
247
|
-
<script type="text/javascript">loadPreferences()</script>
|
248
|
-
|
249
|
-
<div id="wrapper">
|
250
|
-
PATCH
|
251
|
-
end
|
252
|
-
end
|
253
|
-
|
254
|
-
describe 'with changes to multiple files and a file path argument' do
|
255
|
-
before do
|
256
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.3') + '/.', "#{@repository_dir}/skit1")
|
257
|
-
in_dir(@repository_dir) do
|
258
|
-
run_command('git add *')
|
259
|
-
run_command('git commit -m "Some local changes"')
|
260
|
-
end
|
261
|
-
end
|
262
|
-
|
263
|
-
it 'should show only the diff in the specified file' do
|
264
|
-
diff = nil
|
265
|
-
in_dir(@repository_dir) do
|
266
|
-
# Test that file paths are taken relative to the downstream repository
|
267
|
-
# root, as documented, rather than the mirror.
|
268
|
-
diff = run_command("#{BRAID_BIN} diff skit1 -- skit1/layouts/README.md")
|
269
|
-
end
|
270
|
-
|
271
|
-
expect(diff).to eq(<<PATCH)
|
272
|
-
diff --git a/layouts/README.md b/layouts/README.md
|
273
|
-
new file mode 100644
|
274
|
-
index 0000000..69dc7e6
|
275
|
-
--- /dev/null
|
276
|
-
+++ b/layouts/README.md
|
277
|
-
@@ -0,0 +1 @@
|
278
|
-
+I would write something here if I knew what this was...
|
279
|
-
PATCH
|
280
|
-
end
|
281
|
-
end
|
282
|
-
end
|
283
|
-
|
284
|
-
describe 'braided subdirectory into' do
|
285
|
-
before do
|
286
|
-
in_dir(@repository_dir) do
|
287
|
-
run_command("#{BRAID_BIN} add #{@vendor_repository_dir} --path layouts skit-layouts")
|
288
|
-
end
|
289
|
-
end
|
290
|
-
|
291
|
-
describe 'with no changes' do
|
292
|
-
it 'with the mirror specified should emit no output' do
|
293
|
-
diff = nil
|
294
|
-
in_dir(@repository_dir) do
|
295
|
-
diff = run_command("#{BRAID_BIN} diff skit-layouts")
|
296
|
-
end
|
297
|
-
|
298
|
-
expect(diff).to eq('')
|
299
|
-
end
|
300
|
-
|
301
|
-
it 'without specifying a mirror should emit only banners' do
|
302
|
-
diff = nil
|
303
|
-
in_dir(@repository_dir) do
|
304
|
-
diff = run_command("#{BRAID_BIN} diff")
|
305
|
-
end
|
306
|
-
|
307
|
-
expect(diff).to eq("=======================================================\nBraid: Diffing skit-layouts\n=======================================================\n")
|
308
|
-
end
|
309
|
-
end
|
310
|
-
|
311
|
-
|
312
|
-
describe 'with changes' do
|
313
|
-
before do
|
314
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1') + '/layouts/.', "#{@repository_dir}/skit-layouts")
|
315
|
-
in_dir(@repository_dir) do
|
316
|
-
run_command('git add *')
|
317
|
-
run_command('git commit -m "Some local changes"')
|
318
|
-
end
|
319
|
-
end
|
320
|
-
|
321
|
-
it 'with the mirror specified should emit diff' do
|
322
|
-
diff = nil
|
323
|
-
in_dir(@repository_dir) do
|
324
|
-
diff = run_command("#{BRAID_BIN} diff skit-layouts")
|
325
|
-
end
|
326
|
-
|
327
|
-
expect(diff).to eq(<<PATCH)
|
328
|
-
diff --git a/layout.liquid b/layout.liquid
|
329
|
-
index 9f75009..25a4b32 100644
|
330
|
-
--- a/layout.liquid
|
331
|
-
+++ b/layout.liquid
|
332
|
-
@@ -22,7 +22,7 @@
|
333
|
-
<![endif]-->
|
334
|
-
</head>
|
335
|
-
|
336
|
-
-<body class="fixed orange">
|
337
|
-
+<body class="fixed green">
|
338
|
-
<script type="text/javascript">loadPreferences()</script>
|
339
|
-
|
340
|
-
<div id="wrapper">
|
341
|
-
PATCH
|
342
|
-
end
|
343
|
-
|
344
|
-
it 'without specifying a mirror should emit diff and banners' do
|
345
|
-
diff = nil
|
346
|
-
in_dir(@repository_dir) do
|
347
|
-
diff = run_command("#{BRAID_BIN} diff")
|
348
|
-
end
|
349
|
-
|
350
|
-
expect(diff).to eq(<<PATCH)
|
351
|
-
=======================================================
|
352
|
-
Braid: Diffing skit-layouts
|
353
|
-
=======================================================
|
354
|
-
diff --git a/layout.liquid b/layout.liquid
|
355
|
-
index 9f75009..25a4b32 100644
|
356
|
-
--- a/layout.liquid
|
357
|
-
+++ b/layout.liquid
|
358
|
-
@@ -22,7 +22,7 @@
|
359
|
-
<![endif]-->
|
360
|
-
</head>
|
361
|
-
|
362
|
-
-<body class="fixed orange">
|
363
|
-
+<body class="fixed green">
|
364
|
-
<script type="text/javascript">loadPreferences()</script>
|
365
|
-
|
366
|
-
<div id="wrapper">
|
367
|
-
PATCH
|
368
|
-
end
|
369
|
-
end
|
370
|
-
end
|
371
|
-
|
372
|
-
describe 'braided from a single file' do
|
373
|
-
before do
|
374
|
-
in_dir(@repository_dir) do
|
375
|
-
run_command("#{BRAID_BIN} add #{@vendor_repository_dir} --path layouts/layout.liquid skit-layout.liquid")
|
376
|
-
end
|
377
|
-
end
|
378
|
-
|
379
|
-
describe 'with no changes' do
|
380
|
-
it 'with the mirror specified should emit no output' do
|
381
|
-
diff = nil
|
382
|
-
in_dir(@repository_dir) do
|
383
|
-
diff = run_command("#{BRAID_BIN} diff skit-layout.liquid")
|
384
|
-
end
|
385
|
-
|
386
|
-
expect(diff).to eq('')
|
387
|
-
end
|
388
|
-
|
389
|
-
it 'without specifying a mirror should emit only banners' do
|
390
|
-
diff = nil
|
391
|
-
in_dir(@repository_dir) do
|
392
|
-
diff = run_command("#{BRAID_BIN} diff")
|
393
|
-
end
|
394
|
-
|
395
|
-
expect(diff).to eq("=======================================================\nBraid: Diffing skit-layout.liquid\n=======================================================\n")
|
396
|
-
end
|
397
|
-
end
|
398
|
-
|
399
|
-
|
400
|
-
describe 'with changes' do
|
401
|
-
before do
|
402
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1') + '/layouts/layout.liquid', "#{@repository_dir}/skit-layout.liquid",
|
403
|
-
preserve: true)
|
404
|
-
in_dir(@repository_dir) do
|
405
|
-
run_command('git add *')
|
406
|
-
run_command('git commit -m "Some local changes"')
|
407
|
-
end
|
408
|
-
end
|
409
|
-
|
410
|
-
it 'with the mirror specified should emit diff' do
|
411
|
-
diff = nil
|
412
|
-
in_dir(@repository_dir) do
|
413
|
-
diff = run_command("#{BRAID_BIN} diff skit-layout.liquid")
|
414
|
-
end
|
415
|
-
|
416
|
-
expect(diff).to eq(<<PATCH)
|
417
|
-
diff --git a/layout.liquid b/skit-layout.liquid
|
418
|
-
index 9f75009..25a4b32 100644
|
419
|
-
--- a/layout.liquid
|
420
|
-
+++ b/skit-layout.liquid
|
421
|
-
@@ -22,7 +22,7 @@
|
422
|
-
<![endif]-->
|
423
|
-
</head>
|
424
|
-
|
425
|
-
-<body class="fixed orange">
|
426
|
-
+<body class="fixed green">
|
427
|
-
<script type="text/javascript">loadPreferences()</script>
|
428
|
-
|
429
|
-
<div id="wrapper">
|
430
|
-
PATCH
|
431
|
-
end
|
432
|
-
|
433
|
-
it 'without specifying a mirror should emit diff and banners' do
|
434
|
-
diff = nil
|
435
|
-
in_dir(@repository_dir) do
|
436
|
-
diff = run_command("#{BRAID_BIN} diff")
|
437
|
-
end
|
438
|
-
|
439
|
-
expect(diff).to eq(<<PATCH)
|
440
|
-
=======================================================
|
441
|
-
Braid: Diffing skit-layout.liquid
|
442
|
-
=======================================================
|
443
|
-
diff --git a/layout.liquid b/skit-layout.liquid
|
444
|
-
index 9f75009..25a4b32 100644
|
445
|
-
--- a/layout.liquid
|
446
|
-
+++ b/skit-layout.liquid
|
447
|
-
@@ -22,7 +22,7 @@
|
448
|
-
<![endif]-->
|
449
|
-
</head>
|
450
|
-
|
451
|
-
-<body class="fixed orange">
|
452
|
-
+<body class="fixed green">
|
453
|
-
<script type="text/javascript">loadPreferences()</script>
|
454
|
-
|
455
|
-
<div id="wrapper">
|
456
|
-
PATCH
|
457
|
-
end
|
458
|
-
end
|
459
|
-
|
460
|
-
describe 'with changes including a mode change' do
|
461
|
-
before do
|
462
|
-
in_dir(@repository_dir) do
|
463
|
-
@filemode_enabled = filemode_enabled
|
464
|
-
end
|
465
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1x') + '/layouts/layout.liquid', "#{@repository_dir}/skit-layout.liquid",
|
466
|
-
preserve: true)
|
467
|
-
in_dir(@repository_dir) do
|
468
|
-
run_command('git add *')
|
469
|
-
run_command('git commit -m "Some local changes"')
|
470
|
-
end
|
471
|
-
end
|
472
|
-
|
473
|
-
it 'with the mirror specified should emit diff' do
|
474
|
-
# Right way to do this? See
|
475
|
-
# https://github.com/cucumber/aruba/issues/301 . It's unclear what
|
476
|
-
# we'd have to do to get the information in time to use :unless. If
|
477
|
-
# we don't do that, a success seems less bad than a known
|
478
|
-
# failure ("pending").
|
479
|
-
next unless @filemode_enabled
|
480
|
-
|
481
|
-
diff = nil
|
482
|
-
in_dir(@repository_dir) do
|
483
|
-
diff = run_command("#{BRAID_BIN} diff skit-layout.liquid")
|
484
|
-
end
|
485
|
-
|
486
|
-
expect(diff).to eq(<<PATCH)
|
487
|
-
diff --git a/layout.liquid b/skit-layout.liquid
|
488
|
-
old mode 100644
|
489
|
-
new mode 100755
|
490
|
-
index 9f75009..25a4b32
|
491
|
-
--- a/layout.liquid
|
492
|
-
+++ b/skit-layout.liquid
|
493
|
-
@@ -22,7 +22,7 @@
|
494
|
-
<![endif]-->
|
495
|
-
</head>
|
496
|
-
|
497
|
-
-<body class="fixed orange">
|
498
|
-
+<body class="fixed green">
|
499
|
-
<script type="text/javascript">loadPreferences()</script>
|
500
|
-
|
501
|
-
<div id="wrapper">
|
502
|
-
PATCH
|
503
|
-
end
|
504
|
-
|
505
|
-
it 'without specifying a mirror should emit diff and banners' do
|
506
|
-
next unless @filemode_enabled
|
507
|
-
|
508
|
-
diff = nil
|
509
|
-
in_dir(@repository_dir) do
|
510
|
-
diff = run_command("#{BRAID_BIN} diff")
|
511
|
-
end
|
512
|
-
|
513
|
-
expect(diff).to eq(<<PATCH)
|
514
|
-
=======================================================
|
515
|
-
Braid: Diffing skit-layout.liquid
|
516
|
-
=======================================================
|
517
|
-
diff --git a/layout.liquid b/skit-layout.liquid
|
518
|
-
old mode 100644
|
519
|
-
new mode 100755
|
520
|
-
index 9f75009..25a4b32
|
521
|
-
--- a/layout.liquid
|
522
|
-
+++ b/skit-layout.liquid
|
523
|
-
@@ -22,7 +22,7 @@
|
524
|
-
<![endif]-->
|
525
|
-
</head>
|
526
|
-
|
527
|
-
-<body class="fixed orange">
|
528
|
-
+<body class="fixed green">
|
529
|
-
<script type="text/javascript">loadPreferences()</script>
|
530
|
-
|
531
|
-
<div id="wrapper">
|
532
|
-
PATCH
|
533
|
-
end
|
534
|
-
end
|
535
|
-
end
|
536
|
-
|
537
|
-
describe 'braided as a tag directly in' do
|
538
|
-
before do
|
539
|
-
in_dir(@repository_dir) do
|
540
|
-
run_command("#{BRAID_BIN} add #{@vendor_repository_dir} --tag v1")
|
541
|
-
end
|
542
|
-
end
|
543
|
-
|
544
|
-
describe 'with no changes' do
|
545
|
-
it 'with the mirror specified should emit no output' do
|
546
|
-
diff = nil
|
547
|
-
in_dir(@repository_dir) do
|
548
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
549
|
-
end
|
550
|
-
|
551
|
-
expect(diff).to eq('')
|
552
|
-
end
|
553
|
-
|
554
|
-
it 'without specifying a mirror should emit only banners' do
|
555
|
-
diff = nil
|
556
|
-
in_dir(@repository_dir) do
|
557
|
-
diff = run_command("#{BRAID_BIN} diff")
|
558
|
-
end
|
559
|
-
|
560
|
-
expect(diff).to eq("=======================================================\nBraid: Diffing skit1\n=======================================================\n")
|
561
|
-
end
|
562
|
-
end
|
563
|
-
|
564
|
-
describe 'with changes' do
|
565
|
-
before do
|
566
|
-
FileUtils.cp_r(File.join(FIXTURE_PATH, 'skit1.1') + '/.', "#{@repository_dir}/skit1")
|
567
|
-
in_dir(@repository_dir) do
|
568
|
-
run_command('git add *')
|
569
|
-
run_command('git commit -m "Some local changes"')
|
570
|
-
end
|
571
|
-
end
|
572
|
-
|
573
|
-
it 'with the mirror specified should emit diff' do
|
574
|
-
diff = nil
|
575
|
-
in_dir(@repository_dir) do
|
576
|
-
diff = run_command("#{BRAID_BIN} diff skit1")
|
577
|
-
end
|
578
|
-
|
579
|
-
expect(diff).to eq(<<PATCH)
|
580
|
-
diff --git a/layouts/layout.liquid b/layouts/layout.liquid
|
581
|
-
index 9f75009..25a4b32 100644
|
582
|
-
--- a/layouts/layout.liquid
|
583
|
-
+++ b/layouts/layout.liquid
|
584
|
-
@@ -22,7 +22,7 @@
|
585
|
-
<![endif]-->
|
586
|
-
</head>
|
587
|
-
|
588
|
-
-<body class="fixed orange">
|
589
|
-
+<body class="fixed green">
|
590
|
-
<script type="text/javascript">loadPreferences()</script>
|
591
|
-
|
592
|
-
<div id="wrapper">
|
593
|
-
PATCH
|
594
|
-
end
|
595
|
-
end
|
596
|
-
end
|
597
|
-
end
|