File: fix_tests_for_rspec3.3.0.patch

package info (click to toggle)
ruby-bluefeather 0.41-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 664 kB
  • sloc: ruby: 4,195; makefile: 8
file content (350 lines) | stat: -rw-r--r-- 9,301 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
Description: Fix test for rspec version 3.3.0
 In order for the tests to run on rspec 3.3.0, it was necessary
 to update the rspec methods be_false and be_true to be_falsey and
 be_truthy, respectivelly. Also, it was necessary to change the
 shared_as blocks for shared_context ones, since it is the new way
 for rspec tests.

 This fix will not be sent to the upstream, because the tool being used
 to hold the source code doesn't seem to allow merge requests.

Author: Lucas Albuquerque Medeiros de Moura <lucas.moura128@gmail.com>
Last-updated: 2016-03-02
Forwarded: not-needed
Bug: not-needed

Index: ruby-bluefeather/spec/code-block.rb
===================================================================
--- ruby-bluefeather.orig/spec/code-block.rb	2016-03-02 13:53:07.911846126 -0300
+++ ruby-bluefeather/spec/code-block.rb	2016-03-02 13:53:07.907846132 -0300
@@ -30,19 +30,19 @@
 
 
 	describe 'Basic:' do
-		share_as :Examples do
-			specify 'overview' do
+		shared_context 'examples' do
+			it 'overview' do
 				@doc.should have_elements(1, 'pre code')
 				@doc.should_not have_element('p')
 			end
 			
-			specify 'body' do
+			it 'body' do
 				@doc.at('pre code').inner_text.should == "Fenced Code\nBlock\n"
 			end
 		end
 		
-		share_as :NegativeExamples do
-			specify 'overview' do
+		shared_context 'negative examples' do
+			it 'overview' do
 				@doc.should_not have_elements(1, 'pre code')
 				@doc.should have_elements(1, 'p')
 			end
@@ -50,7 +50,7 @@
 
 	
 		describe 'Standard:' do
-			include Examples
+			include_context "examples"
 			before(:all) do
 				@src = "~~~\nFenced Code\nBlock\n~~~"
 			end
@@ -59,28 +59,28 @@
 
 		
 		describe 'Many Symbols:' do
-			include Examples
+			include_context "examples"
 			before(:all) do
 				@src = "~~~~~~\nFenced Code\nBlock\n~~~~~~"
 			end
 		end
 		
 		describe 'Original Code Block:' do
-			include Examples
+			include_context "examples"
 			before(:all) do
 				@src = "    Fenced Code\n    Block"
 			end
 		end
 		
 		describe 'Bad (wrong number of symbols):' do
-			include NegativeExamples
+			include_context "negative examples"
 			before(:all) do
 				@src = "~~~~~~\nFenced Code\nBlock\n~~~"
 			end
 		end
 
 		describe 'Bad (symbols is not on line-head.):' do
-			include NegativeExamples
+			include_context "negative examples"
 			before(:all) do
 				@src = " ~~~\nFenced Code\nBlock\n ~~~"
 			end
@@ -250,4 +250,4 @@
 
 	end
 	
-end
\ No newline at end of file
+end
Index: ruby-bluefeather/spec/encoding.rb
===================================================================
--- ruby-bluefeather.orig/spec/encoding.rb	2016-03-02 13:53:07.911846126 -0300
+++ ruby-bluefeather/spec/encoding.rb	2016-03-02 13:54:06.727747337 -0300
@@ -8,9 +8,9 @@
 describe 'Internal encoding specification:' do
 	specify "utf-8 bom check" do
 		src = '日本語'.kconv(Kconv::SJIS, Kconv::UTF8)
-		BlueFeather::Util.utf8_bom?(src).should be_false
+		BlueFeather::Util.utf8_bom?(src).should be_falsey
 		bom_src = "\xef\xbb\xbf日本語"
-		BlueFeather::Util.utf8_bom?(bom_src).should be_true
+		BlueFeather::Util.utf8_bom?(bom_src).should be_truthy
 	end
 	
 	specify "'shift-jis' is available:" do
@@ -27,26 +27,26 @@
 		@doc = Nokogiri(@html)
 	end
 	
-	share_as :Base do
-		specify 'header parse - css' do
+	shared_context 'base' do
+		it 'header parse - css' do
 			@doc.should have_element('link[@rel="stylesheet"][@href="style.css"]')
 		end
 
-		specify 'header parse - encoding' do
+		it 'header parse - encoding' do
 			@doc.should have_element(%Q|meta[@http-equiv="Content-Type"][@content="text/html; charset=#{@charset}"]|)
 		end
 		
-		specify 'header parse - title' do
+		it 'header parse - title' do
 			base = '日本語の題名'.kconv(@kconv_encoding, Kconv::UTF8)
 			@doc.at('title').inner_html.should == base
 		end
 		
-		specify 'content parse - p' do
+		it 'content parse - p' do
 			base = 'このテキストファイルは、エンコーディングテスト用のテキストファイルです。'.kconv(@kconv_encoding, Kconv::UTF8)
 			@doc.at('p').inner_html.should == base
 		end
 		
-		specify 'content parse - ul' do
+		it 'content parse - ul' do
 			@doc.should have_elements(1, 'ul')
 			
 			items = @doc.search('ul li')
@@ -60,7 +60,7 @@
 	
 	
 	describe 'Default:' do
-		include Base
+		include_context 'base'
 		
 		before(:all) do
 			@src_name = 'encoding_sample_default.bfdoc'
@@ -71,7 +71,7 @@
 
 
 	describe 'UTF-8 (BOM):' do
-		include Base
+		include_context 'base'
 		
 		before(:all) do
 			@src_name = 'encoding_sample_utf-8.bfdoc'
@@ -82,7 +82,7 @@
 	
 	
 	describe 'UTF-8N:' do
-		include Base
+		include_context 'base'
 		
 		before(:all) do
 			@src_name = 'encoding_sample_utf-8n.bfdoc'
@@ -93,7 +93,7 @@
 
 	
 	describe 'Shift_JIS:' do
-		include Base
+		include_context 'base'
 		
 		before(:all) do
 			@src_name = 'encoding_sample_shift-jis.bfdoc'
@@ -103,7 +103,7 @@
 	end
 	
 	describe 'EUC-JP:' do
-		include Base
+		include_context 'base'
 		
 		before(:all) do
 			@src_name = 'encoding_sample_euc-jp.bfdoc'
@@ -111,4 +111,4 @@
 			@kconv_encoding = Kconv::EUC
 		end
 	end
-end
\ No newline at end of file
+end
Index: ruby-bluefeather/spec/table.rb
===================================================================
--- ruby-bluefeather.orig/spec/table.rb	2016-03-02 13:53:07.911846126 -0300
+++ ruby-bluefeather/spec/table.rb	2016-03-02 13:53:07.911846126 -0300
@@ -10,12 +10,12 @@
 		@doc = Nokogiri(@html)
 	end
 	
-	share_as :StandardTable do
-		specify "table overview" do
+	shared_context 'standard table' do
+		it "table overview" do
 			@doc.should have_elements(1, 'table')
 		end
 		
-		specify "size 3x3" do
+		it "size 3x3" do
 			@doc.should have_elements(3, 'tr')
 			@doc.should have_elements(1, 'thead tr')
 			@doc.should have_elements(2, 'tbody tr')
@@ -23,7 +23,7 @@
 			@doc.should have_elements(6, 'tbody tr td')
 		end
 		
-		specify "alignment" do
+		it "alignment" do
 			@doc.search('tr').each do |tr|
 				cells = tr.search('th, td')
 				cells[0]['style'].should be_nil
@@ -32,14 +32,14 @@
 			end
 		end
 		
-		specify "purity" do
+		it "purity" do
 			@doc.should_not have_element('p table')
 		end
 	end
 
 
 	describe 'no-doubleline' do
-		include StandardTable
+		include_context 'standard table'
 	
 		before(:all) do
 			@src = "|h1|h2|h3\n|-|-:|:-:\n|d11|d21|d31\n|d12|d22|d32"
@@ -49,7 +49,7 @@
 	
 	
 	describe 'doubleline: ' do
-		include StandardTable
+		include_context 'standard table'
 
 		before(:all) do
 			@src = "|h1|h2|h3|\n|-|-:|:-:|\n|d11|d21|d31|\n|d12|d22|d32|"
@@ -57,7 +57,7 @@
 	end
 	
 	describe 'inner space:' do
-		include StandardTable
+		include_context 'standard table'
 	
 		before(:all) do
 			@src = "| h1 | h2 | h3 \n| - | -: | :-: \n| d11 | d21 | d31\n| d12 | d22 | d32"
@@ -65,7 +65,7 @@
 	end
 
 	describe 'left space:' do
-		include StandardTable
+		include_context 'standard table'
 	
 		before(:all) do
 			@src = " | h1 | h2 | h3 \n | - | -: | :-: \n | d11 | d21 | d31\n | d12 | d22 | d32"
@@ -74,7 +74,7 @@
 
 
 	describe 'in definition list:' do
-		include StandardTable
+		include_context 'standard table'
 	
 		before(:all) do
 			@src = <<MARKDOWN
@@ -91,4 +91,4 @@
 	end
 
 
-end
\ No newline at end of file
+end
Index: ruby-bluefeather/spec/toc.rb
===================================================================
--- ruby-bluefeather.orig/spec/toc.rb	2016-03-02 13:53:07.911846126 -0300
+++ ruby-bluefeather/spec/toc.rb	2016-03-02 13:53:07.911846126 -0300
@@ -29,8 +29,8 @@
 
 	
 	
-		share_as :ContentOverview do
-			specify 'overview' do
+		shared_context 'content overview' do
+		    it 'overview' do
 				@doc.should have_element('ul')
 				@doc.should have_elements(1, 'h1')
 				@doc.should have_elements(3, 'h2')
@@ -40,7 +40,7 @@
 	
 	
 		describe 'basic:' do
-			include ContentOverview
+			 include_context 'content overview'
 			before(:all) do
 				@src = "{toc}\n\n" +  @header_part
 			end
@@ -73,7 +73,7 @@
 		
 		
 		describe 'range:' do
-			include ContentOverview
+			 include_context 'content overview'
 			before(:all) do
 				@src = "{toc:h1..h2}\n\n" +  @header_part
 			end
@@ -144,4 +144,4 @@
 	
 
 
-end
\ No newline at end of file
+end
Index: ruby-bluefeather/spec/cui.rb
===================================================================
--- ruby-bluefeather.orig/spec/cui.rb	2016-03-02 13:53:07.911846126 -0300
+++ ruby-bluefeather/spec/cui.rb	2016-03-02 13:53:25.847816025 -0300
@@ -57,18 +57,18 @@
 		sample_src = (Pathname.new(__FILE__).parent + 'text/encoding_sample_ascii.bfdoc').to_s
 		valids.each do |name|
 			specify "'#{name}' is valid" do
-				@cui.run(['--encoding', name, '-']).should be_true
+				@cui.run(['--encoding', name, '-']).should be_truthy
 			end
 		end
 		
 		invalids = %w(euc_jp none jis)
 		invalids.each do |name|
 			specify "'#{name}' is invalid" do
-				@cui.run(['--encoding', name, '-']).should be_false
+				@cui.run(['--encoding', name, '-']).should be_falsey
 			end
 		end
 		
 	end
 
 
-end
\ No newline at end of file
+end