[DRE-commits] [ruby-bluefeather] 01/03: Fix package tests

Lucas Moura lucasmoura-guest at moszumanska.debian.org
Wed Mar 2 17:56:55 UTC 2016


This is an automated email from the git hooks/post-receive script.

lucasmoura-guest pushed a commit to branch master
in repository ruby-bluefeather.

commit a240c41db33925a5fd11f1b8a4d3adfb5d89917b
Author: Lucas Albuquerque Medeiros de Moura <lucas.moura128 at gmail.com>
Date:   Wed Mar 2 14:06:40 2016 -0300

    Fix package tests
---
 debian/changelog                              |   7 +
 debian/patches/fix_tests_for_rspec3.3.0.patch | 350 ++++++++++++++++++++++++++
 debian/patches/series                         |   1 +
 3 files changed, 358 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 5b4f3ba..adfa2fa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ruby-bluefeather (0.41-4) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Fix tests for rspec version 3.3.0
+
+ -- Lucas Albuquerque Medeiros de Moura <lucas.moura128 at gmail.com>  Wed, 02 Mar 2016 14:05:40 -0300
+
 ruby-bluefeather (0.41-3) unstable; urgency=medium
 
   * Bump standard version: 3.9.6 (not changed)
diff --git a/debian/patches/fix_tests_for_rspec3.3.0.patch b/debian/patches/fix_tests_for_rspec3.3.0.patch
new file mode 100644
index 0000000..f8c7a20
--- /dev/null
+++ b/debian/patches/fix_tests_for_rspec3.3.0.patch
@@ -0,0 +1,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 at 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
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..60173c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+fix_tests_for_rspec3.3.0.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-bluefeather.git



More information about the Pkg-ruby-extras-commits mailing list