From c5126e01b684bdf90e2817010eb20585cb4cc2d9 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Wed, 25 May 2016 13:24:46 +0200 Subject: [PATCH] Fix test suite for Ruby 2.3 compatibility. (rhbz#1308100) --- ...m-yard-0.8.7.6-fix-test-for-ruby-2.3.patch | 23 +++++++++++++++++++ rubygem-yard.spec | 10 +++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 rubygem-yard-0.8.7.6-fix-test-for-ruby-2.3.patch diff --git a/rubygem-yard-0.8.7.6-fix-test-for-ruby-2.3.patch b/rubygem-yard-0.8.7.6-fix-test-for-ruby-2.3.patch new file mode 100644 index 0000000..e67a67b --- /dev/null +++ b/rubygem-yard-0.8.7.6-fix-test-for-ruby-2.3.patch @@ -0,0 +1,23 @@ +From afbcbc18efbf56ae81842094c78ac6ad218e9922 Mon Sep 17 00:00:00 2001 +From: Loren Segal +Date: Thu, 14 Apr 2016 23:52:09 -0700 +Subject: [PATCH] Fix brittle test on Ruby 2.3 + +Fixes #927 +--- + spec/parser/ruby/ruby_parser_spec.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/spec/parser/ruby/ruby_parser_spec.rb b/spec/parser/ruby/ruby_parser_spec.rb +index 6e5bd89..07d7212 100644 +--- a/spec/parser/ruby/ruby_parser_spec.rb ++++ b/spec/parser/ruby/ruby_parser_spec.rb +@@ -351,7 +351,7 @@ eof + # end comment + end + eof +- comment = ast.first.last.first ++ comment = ast.first.last.jump(:comment) + comment.type.should == :comment + comment.docstring_hash_flag.should be_true + comment.docstring.strip.should == "comment here" diff --git a/rubygem-yard.spec b/rubygem-yard.spec index a86f96c..4e1ea7f 100644 --- a/rubygem-yard.spec +++ b/rubygem-yard.spec @@ -2,7 +2,7 @@ Name: rubygem-%{gem_name} Version: 0.8.7.6 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Documentation tool for consistent and usable documentation in Ruby Group: Development/Languages License: MIT and (BSD or Ruby) @@ -17,6 +17,10 @@ BuildRequires: rubygem(redcarpet) BuildRequires: rubygem(rack) BuildArch: noarch +# Fix test suite in Ruby 2.3. +# https://github.com/lsegal/yard/commit/afbcbc1.patch +Patch0: rubygem-yard-0.8.7.6-fix-test-for-ruby-2.3.patch + %description YARD is a documentation generation tool for the Ruby programming language. It enables the user to generate consistent, usable documentation that can be @@ -56,6 +60,7 @@ pushd .%{gem_instdir} # provides more recent RSpec :/ sed -i '/File\.stub(:exist?).with(\/\\\.yardopts$\/)/ i\ File.stub(:exist?).and_return(true)' spec/cli/server_spec.rb +patch -p1 < %{PATCH0} rspec2 spec popd @@ -88,6 +93,9 @@ popd %changelog +* Wed May 25 2016 Jun Aruga - 0.8.7.6-3 +- Fix test suite for Ruby 2.3 compatibility. (rhbz#1308100) + * Thu Feb 04 2016 Fedora Release Engineering - 0.8.7.6-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild