diff-lcs 1.3 → 1.4.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,54 +1,54 @@
1
- # -*- ruby encoding: utf-8 -*-
1
+ # frozen_string_literal: true
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe "Diff::LCS.patch" do
5
+ describe 'Diff::LCS.patch' do
6
6
  include Diff::LCS::SpecHelper::Matchers
7
7
 
8
- shared_examples "patch sequences correctly" do
9
- it "correctly patches left-to-right (patch autodiscovery)" do
8
+ shared_examples 'patch sequences correctly' do
9
+ it 'correctly patches left-to-right (patch autodiscovery)' do
10
10
  expect(Diff::LCS.patch(s1, patch_set)).to eq(s2)
11
11
  end
12
12
 
13
- it "correctly patches left-to-right (explicit patch)" do
13
+ it 'correctly patches left-to-right (explicit patch)' do
14
14
  expect(Diff::LCS.patch(s1, patch_set, :patch)).to eq(s2)
15
15
  expect(Diff::LCS.patch!(s1, patch_set)).to eq(s2)
16
16
  end
17
17
 
18
- it "correctly patches right-to-left (unpatch autodiscovery)" do
18
+ it 'correctly patches right-to-left (unpatch autodiscovery)' do
19
19
  expect(Diff::LCS.patch(s2, patch_set)).to eq(s1)
20
20
  end
21
21
 
22
- it "correctly patches right-to-left (explicit unpatch)" do
22
+ it 'correctly patches right-to-left (explicit unpatch)' do
23
23
  expect(Diff::LCS.patch(s2, patch_set, :unpatch)).to eq(s1)
24
24
  expect(Diff::LCS.unpatch!(s2, patch_set)).to eq(s1)
25
25
  end
26
26
  end
27
27
 
28
- describe "using a Diff::LCS.diff patchset" do
29
- describe "an empty patchset returns the source" do
30
- it "works on a string (hello)" do
28
+ describe 'using a Diff::LCS.diff patchset' do
29
+ describe 'an empty patchset returns the source' do
30
+ it 'works on a string (hello)' do
31
31
  diff = Diff::LCS.diff(hello, hello)
32
- expect(Diff::LCS::patch(hello, diff)).to eq(hello)
32
+ expect(Diff::LCS.patch(hello, diff)).to eq(hello)
33
33
  end
34
34
 
35
- it "works on an array %W(h e l l o)" do
35
+ it 'works on an array %W(h e l l o)' do
36
36
  diff = Diff::LCS.diff(hello_ary, hello_ary)
37
- expect(Diff::LCS::patch(hello_ary, diff)).to eq(hello_ary)
37
+ expect(Diff::LCS.patch(hello_ary, diff)).to eq(hello_ary)
38
38
  end
39
39
  end
40
40
 
41
- describe "with default diff callbacks (DiffCallbacks)" do
42
- describe "forward (s1 -> s2)" do
43
- it_has_behavior "patch sequences correctly" do
41
+ describe 'with default diff callbacks (DiffCallbacks)' do
42
+ describe 'forward (s1 -> s2)' do
43
+ it_has_behavior 'patch sequences correctly' do
44
44
  let(:s1) { seq1 }
45
45
  let(:s2) { seq2 }
46
46
  let(:patch_set) { Diff::LCS.diff(seq1, seq2) }
47
47
  end
48
48
  end
49
49
 
50
- describe "reverse (s2 -> s1)" do
51
- it_has_behavior "patch sequences correctly" do
50
+ describe 'reverse (s2 -> s1)' do
51
+ it_has_behavior 'patch sequences correctly' do
52
52
  let(:s1) { seq2 }
53
53
  let(:s2) { seq1 }
54
54
  let(:patch_set) { Diff::LCS.diff(seq2, seq1) }
@@ -56,9 +56,9 @@ describe "Diff::LCS.patch" do
56
56
  end
57
57
  end
58
58
 
59
- describe "with context diff callbacks (ContextDiffCallbacks)" do
60
- describe "forward (s1 -> s2)" do
61
- it_has_behavior "patch sequences correctly" do
59
+ describe 'with context diff callbacks (ContextDiffCallbacks)' do
60
+ describe 'forward (s1 -> s2)' do
61
+ it_has_behavior 'patch sequences correctly' do
62
62
  let(:s1) { seq1 }
63
63
  let(:s2) { seq2 }
64
64
  let(:patch_set) {
@@ -67,8 +67,8 @@ describe "Diff::LCS.patch" do
67
67
  end
68
68
  end
69
69
 
70
- describe "reverse (s2 -> s1)" do
71
- it_has_behavior "patch sequences correctly" do
70
+ describe 'reverse (s2 -> s1)' do
71
+ it_has_behavior 'patch sequences correctly' do
72
72
  let(:s1) { seq2 }
73
73
  let(:s2) { seq1 }
74
74
  let(:patch_set) {
@@ -78,9 +78,9 @@ describe "Diff::LCS.patch" do
78
78
  end
79
79
  end
80
80
 
81
- describe "with sdiff callbacks (SDiffCallbacks)" do
82
- describe "forward (s1 -> s2)" do
83
- it_has_behavior "patch sequences correctly" do
81
+ describe 'with sdiff callbacks (SDiffCallbacks)' do
82
+ describe 'forward (s1 -> s2)' do
83
+ it_has_behavior 'patch sequences correctly' do
84
84
  let(:s1) { seq1 }
85
85
  let(:s2) { seq2 }
86
86
  let(:patch_set) {
@@ -89,8 +89,8 @@ describe "Diff::LCS.patch" do
89
89
  end
90
90
  end
91
91
 
92
- describe "reverse (s2 -> s1)" do
93
- it_has_behavior "patch sequences correctly" do
92
+ describe 'reverse (s2 -> s1)' do
93
+ it_has_behavior 'patch sequences correctly' do
94
94
  let(:s1) { seq2 }
95
95
  let(:s2) { seq1 }
96
96
  let(:patch_set) {
@@ -101,20 +101,20 @@ describe "Diff::LCS.patch" do
101
101
  end
102
102
  end
103
103
 
104
- describe "using a Diff::LCS.sdiff patchset" do
105
- describe "an empty patchset returns the source" do
106
- it "works on a string (hello)" do
107
- expect(Diff::LCS::patch(hello, Diff::LCS.sdiff(hello, hello))).to eq(hello)
104
+ describe 'using a Diff::LCS.sdiff patchset' do
105
+ describe 'an empty patchset returns the source' do
106
+ it 'works on a string (hello)' do
107
+ expect(Diff::LCS.patch(hello, Diff::LCS.sdiff(hello, hello))).to eq(hello)
108
108
  end
109
109
 
110
- it "works on an array %W(h e l l o)" do
111
- expect(Diff::LCS::patch(hello_ary, Diff::LCS.sdiff(hello_ary, hello_ary))).to eq(hello_ary)
110
+ it 'works on an array %W(h e l l o)' do
111
+ expect(Diff::LCS.patch(hello_ary, Diff::LCS.sdiff(hello_ary, hello_ary))).to eq(hello_ary)
112
112
  end
113
113
  end
114
114
 
115
- describe "with default diff callbacks (DiffCallbacks)" do
116
- describe "forward (s1 -> s2)" do
117
- it_has_behavior "patch sequences correctly" do
115
+ describe 'with default diff callbacks (DiffCallbacks)' do
116
+ describe 'forward (s1 -> s2)' do
117
+ it_has_behavior 'patch sequences correctly' do
118
118
  let(:s1) { seq1 }
119
119
  let(:s2) { seq2 }
120
120
  let(:patch_set) {
@@ -123,8 +123,8 @@ describe "Diff::LCS.patch" do
123
123
  end
124
124
  end
125
125
 
126
- describe "reverse (s2 -> s1)" do
127
- it_has_behavior "patch sequences correctly" do
126
+ describe 'reverse (s2 -> s1)' do
127
+ it_has_behavior 'patch sequences correctly' do
128
128
  let(:s1) { seq2 }
129
129
  let(:s2) { seq1 }
130
130
  let(:patch_set) {
@@ -134,9 +134,9 @@ describe "Diff::LCS.patch" do
134
134
  end
135
135
  end
136
136
 
137
- describe "with context diff callbacks (DiffCallbacks)" do
138
- describe "forward (s1 -> s2)" do
139
- it_has_behavior "patch sequences correctly" do
137
+ describe 'with context diff callbacks (DiffCallbacks)' do
138
+ describe 'forward (s1 -> s2)' do
139
+ it_has_behavior 'patch sequences correctly' do
140
140
  let(:s1) { seq1 }
141
141
  let(:s2) { seq2 }
142
142
  let(:patch_set) {
@@ -145,8 +145,8 @@ describe "Diff::LCS.patch" do
145
145
  end
146
146
  end
147
147
 
148
- describe "reverse (s2 -> s1)" do
149
- it_has_behavior "patch sequences correctly" do
148
+ describe 'reverse (s2 -> s1)' do
149
+ it_has_behavior 'patch sequences correctly' do
150
150
  let(:s1) { seq2 }
151
151
  let(:s2) { seq1 }
152
152
  let(:patch_set) {
@@ -156,17 +156,17 @@ describe "Diff::LCS.patch" do
156
156
  end
157
157
  end
158
158
 
159
- describe "with sdiff callbacks (SDiffCallbacks)" do
160
- describe "forward (s1 -> s2)" do
161
- it_has_behavior "patch sequences correctly" do
159
+ describe 'with sdiff callbacks (SDiffCallbacks)' do
160
+ describe 'forward (s1 -> s2)' do
161
+ it_has_behavior 'patch sequences correctly' do
162
162
  let(:s1) { seq1 }
163
163
  let(:s2) { seq2 }
164
164
  let(:patch_set) { Diff::LCS.sdiff(seq1, seq2) }
165
165
  end
166
166
  end
167
167
 
168
- describe "reverse (s2 -> s1)" do
169
- it_has_behavior "patch sequences correctly" do
168
+ describe 'reverse (s2 -> s1)' do
169
+ it_has_behavior 'patch sequences correctly' do
170
170
  let(:s1) { seq2 }
171
171
  let(:s2) { seq1 }
172
172
  let(:patch_set) { Diff::LCS.sdiff(seq2, seq1) }
@@ -179,43 +179,43 @@ describe "Diff::LCS.patch" do
179
179
  # to s2 patches"), this cannot use the "patch sequences correctly" shared
180
180
  # set. Once the bug in autodiscovery is fixed, this can be converted as
181
181
  # above.
182
- describe "fix bug 891: patchsets do not contain the last equal part" do
182
+ describe 'fix bug 891: patchsets do not contain the last equal part' do
183
183
  before :each do
184
- @s1 = %w(a b c d e f g h i j k)
184
+ @s1 = %w(a b c d e f g h i j k) # rubocop:disable Layout/SpaceInsideArrayPercentLiteral
185
185
  @s2 = %w(a b c d D e f g h i j k)
186
186
  end
187
187
 
188
- describe "using Diff::LCS.diff with default diff callbacks" do
188
+ describe 'using Diff::LCS.diff with default diff callbacks' do
189
189
  before :each do
190
190
  @patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2)
191
191
  @patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1)
192
192
  end
193
193
 
194
- it "autodiscovers s1 to s2 patches" do
194
+ it 'autodiscovers s1 to s2 patches' do
195
195
  expect do
196
196
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
197
197
  end.to_not raise_error
198
198
  end
199
199
 
200
- it "autodiscovers s2 to s1 patches" do
200
+ it 'autodiscovers s2 to s1 patches' do
201
201
  expect do
202
202
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
203
203
  end.to_not raise_error
204
204
  end
205
205
 
206
- it "autodiscovers s2 to s1 the left-to-right patches" do
206
+ it 'autodiscovers s2 to s1 the left-to-right patches' do
207
207
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
208
208
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
209
209
  end
210
210
 
211
- it "correctly patches left-to-right (explicit patch)" do
211
+ it 'correctly patches left-to-right (explicit patch)' do
212
212
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
213
213
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
214
214
  expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
215
215
  expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
216
216
  end
217
217
 
218
- it "correctly patches right-to-left (explicit unpatch)" do
218
+ it 'correctly patches right-to-left (explicit unpatch)' do
219
219
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
220
220
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
221
221
  expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
@@ -223,39 +223,37 @@ describe "Diff::LCS.patch" do
223
223
  end
224
224
  end
225
225
 
226
- describe "using Diff::LCS.diff with context diff callbacks" do
226
+ describe 'using Diff::LCS.diff with context diff callbacks' do
227
227
  before :each do
228
- @patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2,
229
- Diff::LCS::ContextDiffCallbacks)
230
- @patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1,
231
- Diff::LCS::ContextDiffCallbacks)
228
+ @patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2, Diff::LCS::ContextDiffCallbacks)
229
+ @patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1, Diff::LCS::ContextDiffCallbacks)
232
230
  end
233
231
 
234
- it "autodiscovers s1 to s2 patches" do
232
+ it 'autodiscovers s1 to s2 patches' do
235
233
  expect do
236
234
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
237
235
  end.to_not raise_error
238
236
  end
239
237
 
240
- it "autodiscovers s2 to s1 patches" do
238
+ it 'autodiscovers s2 to s1 patches' do
241
239
  expect do
242
240
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
243
241
  end.to_not raise_error
244
242
  end
245
243
 
246
- it "autodiscovers s2 to s1 the left-to-right patches" do
244
+ it 'autodiscovers s2 to s1 the left-to-right patches' do
247
245
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
248
246
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
249
247
  end
250
248
 
251
- it "correctly patches left-to-right (explicit patch)" do
249
+ it 'correctly patches left-to-right (explicit patch)' do
252
250
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
253
251
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
254
252
  expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
255
253
  expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
256
254
  end
257
255
 
258
- it "correctly patches right-to-left (explicit unpatch)" do
256
+ it 'correctly patches right-to-left (explicit unpatch)' do
259
257
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
260
258
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
261
259
  expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
@@ -263,39 +261,37 @@ describe "Diff::LCS.patch" do
263
261
  end
264
262
  end
265
263
 
266
- describe "using Diff::LCS.diff with sdiff callbacks" do
264
+ describe 'using Diff::LCS.diff with sdiff callbacks' do
267
265
  before(:each) do
268
- @patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2,
269
- Diff::LCS::SDiffCallbacks)
270
- @patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1,
271
- Diff::LCS::SDiffCallbacks)
266
+ @patch_set_s1_s2 = Diff::LCS.diff(@s1, @s2, Diff::LCS::SDiffCallbacks)
267
+ @patch_set_s2_s1 = Diff::LCS.diff(@s2, @s1, Diff::LCS::SDiffCallbacks)
272
268
  end
273
269
 
274
- it "autodiscovers s1 to s2 patches" do
270
+ it 'autodiscovers s1 to s2 patches' do
275
271
  expect do
276
272
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
277
273
  end.to_not raise_error
278
274
  end
279
275
 
280
- it "autodiscovers s2 to s1 patches" do
276
+ it 'autodiscovers s2 to s1 patches' do
281
277
  expect do
282
278
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
283
279
  end.to_not raise_error
284
280
  end
285
281
 
286
- it "autodiscovers s2 to s1 the left-to-right patches" do
282
+ it 'autodiscovers s2 to s1 the left-to-right patches' do
287
283
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
288
284
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
289
285
  end
290
286
 
291
- it "correctly patches left-to-right (explicit patch)" do
287
+ it 'correctly patches left-to-right (explicit patch)' do
292
288
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
293
289
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
294
290
  expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
295
291
  expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
296
292
  end
297
293
 
298
- it "correctly patches right-to-left (explicit unpatch)" do
294
+ it 'correctly patches right-to-left (explicit unpatch)' do
299
295
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
300
296
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
301
297
  expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
@@ -303,37 +299,37 @@ describe "Diff::LCS.patch" do
303
299
  end
304
300
  end
305
301
 
306
- describe "using Diff::LCS.sdiff with default sdiff callbacks" do
302
+ describe 'using Diff::LCS.sdiff with default sdiff callbacks' do
307
303
  before(:each) do
308
304
  @patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2)
309
305
  @patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1)
310
306
  end
311
307
 
312
- it "autodiscovers s1 to s2 patches" do
308
+ it 'autodiscovers s1 to s2 patches' do
313
309
  expect do
314
310
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
315
311
  end.to_not raise_error
316
312
  end
317
313
 
318
- it "autodiscovers s2 to s1 patches" do
314
+ it 'autodiscovers s2 to s1 patches' do
319
315
  expect do
320
316
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
321
317
  end.to_not raise_error
322
318
  end
323
319
 
324
- it "autodiscovers s2 to s1 the left-to-right patches" do
320
+ it 'autodiscovers s2 to s1 the left-to-right patches' do
325
321
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
326
322
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
327
323
  end
328
324
 
329
- it "correctly patches left-to-right (explicit patch)" do
325
+ it 'correctly patches left-to-right (explicit patch)' do
330
326
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
331
327
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
332
328
  expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
333
329
  expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
334
330
  end
335
331
 
336
- it "correctly patches right-to-left (explicit unpatch)" do
332
+ it 'correctly patches right-to-left (explicit unpatch)' do
337
333
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
338
334
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
339
335
  expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
@@ -341,39 +337,37 @@ describe "Diff::LCS.patch" do
341
337
  end
342
338
  end
343
339
 
344
- describe "using Diff::LCS.sdiff with context diff callbacks" do
340
+ describe 'using Diff::LCS.sdiff with context diff callbacks' do
345
341
  before(:each) do
346
- @patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2,
347
- Diff::LCS::ContextDiffCallbacks)
348
- @patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1,
349
- Diff::LCS::ContextDiffCallbacks)
342
+ @patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2, Diff::LCS::ContextDiffCallbacks)
343
+ @patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1, Diff::LCS::ContextDiffCallbacks)
350
344
  end
351
345
 
352
- it "autodiscovers s1 to s2 patches" do
346
+ it 'autodiscovers s1 to s2 patches' do
353
347
  expect do
354
348
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
355
349
  end.to_not raise_error
356
350
  end
357
351
 
358
- it "autodiscovers s2 to s1 patches" do
352
+ it 'autodiscovers s2 to s1 patches' do
359
353
  expect do
360
354
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
361
355
  end.to_not raise_error
362
356
  end
363
357
 
364
- it "autodiscovers s2 to s1 the left-to-right patches" do
358
+ it 'autodiscovers s2 to s1 the left-to-right patches' do
365
359
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
366
360
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
367
361
  end
368
362
 
369
- it "correctly patches left-to-right (explicit patch)" do
363
+ it 'correctly patches left-to-right (explicit patch)' do
370
364
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
371
365
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
372
366
  expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
373
367
  expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
374
368
  end
375
369
 
376
- it "correctly patches right-to-left (explicit unpatch)" do
370
+ it 'correctly patches right-to-left (explicit unpatch)' do
377
371
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
378
372
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
379
373
  expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)
@@ -381,37 +375,37 @@ describe "Diff::LCS.patch" do
381
375
  end
382
376
  end
383
377
 
384
- describe "using Diff::LCS.sdiff with default diff callbacks" do
378
+ describe 'using Diff::LCS.sdiff with default diff callbacks' do
385
379
  before(:each) do
386
380
  @patch_set_s1_s2 = Diff::LCS.sdiff(@s1, @s2, Diff::LCS::DiffCallbacks)
387
381
  @patch_set_s2_s1 = Diff::LCS.sdiff(@s2, @s1, Diff::LCS::DiffCallbacks)
388
382
  end
389
383
 
390
- it "autodiscovers s1 to s2 patches" do
384
+ it 'autodiscovers s1 to s2 patches' do
391
385
  expect do
392
386
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2)).to eq(@s2)
393
387
  end.to_not raise_error
394
388
  end
395
389
 
396
- it "autodiscovers s2 to s1 patches" do
390
+ it 'autodiscovers s2 to s1 patches' do
397
391
  expect do
398
392
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1)).to eq(@s2)
399
393
  end.to_not raise_error
400
394
  end
401
395
 
402
- it "autodiscovers s2 to s1 the left-to-right patches" do
396
+ it 'autodiscovers s2 to s1 the left-to-right patches' do
403
397
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1)).to eq(@s1)
404
398
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2)).to eq(@s1)
405
399
  end
406
400
 
407
- it "correctly patches left-to-right (explicit patch)" do
401
+ it 'correctly patches left-to-right (explicit patch)' do
408
402
  expect(Diff::LCS.patch(@s1, @patch_set_s1_s2, :patch)).to eq(@s2)
409
403
  expect(Diff::LCS.patch(@s2, @patch_set_s2_s1, :patch)).to eq(@s1)
410
404
  expect(Diff::LCS.patch!(@s1, @patch_set_s1_s2)).to eq(@s2)
411
405
  expect(Diff::LCS.patch!(@s2, @patch_set_s2_s1)).to eq(@s1)
412
406
  end
413
407
 
414
- it "correctly patches right-to-left (explicit unpatch)" do
408
+ it 'correctly patches right-to-left (explicit unpatch)' do
415
409
  expect(Diff::LCS.patch(@s2, @patch_set_s1_s2, :unpatch)).to eq(@s1)
416
410
  expect(Diff::LCS.patch(@s1, @patch_set_s2_s1, :unpatch)).to eq(@s2)
417
411
  expect(Diff::LCS.unpatch!(@s2, @patch_set_s1_s2)).to eq(@s1)