diff --git a/.gitignore b/.gitignore index 0676ee7..5f6c351 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /loofah-1.2.1.gem +/loofah-2.0.0.gem diff --git a/rubygem-loofah-2.0.0-tests-rr.patch b/rubygem-loofah-2.0.0-tests-rr.patch new file mode 100644 index 0000000..f80dd34 --- /dev/null +++ b/rubygem-loofah-2.0.0-tests-rr.patch @@ -0,0 +1,37 @@ +From 8c16b393eace237a233ea330b36ec3591a6c3790 Mon Sep 17 00:00:00 2001 +From: Ken Dreyer +Date: Mon, 12 May 2014 13:32:08 -0600 +Subject: [PATCH] tests: load minitest before rr + +When running the tests via rake/hoe (for example, with the `rake test` +command), Rake invokes ruby and loads minitest/autorun before invoking +the any of the actual test suite files. + +On the other hand, when running the tests outside of rake/hoe, the test +suite's helper.rb loads the RR gem before loading minitest/autorun. This +ordering causes the test suite to fail because it cannot recognize the +"mock()" function from RR. + +Switch the ordering so that minitest/autorun loads before rr. This +allows the test suite to pass in both cases. +--- + test/helper.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/test/helper.rb b/test/helper.rb +index d21e102..45fee19 100644 +--- a/test/helper.rb ++++ b/test/helper.rb +@@ -1,8 +1,8 @@ + require 'rubygems' +-require 'rr' + require 'minitest/unit' + require 'minitest/spec' + require 'minitest/autorun' ++require 'rr' + + require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "loofah")) + +-- +1.9.0 + diff --git a/rubygem-loofah.spec b/rubygem-loofah.spec index f931ea8..16411ef 100644 --- a/rubygem-loofah.spec +++ b/rubygem-loofah.spec @@ -1,7 +1,7 @@ %global gem_name loofah Name: rubygem-%{gem_name} -Version: 1.2.1 +Version: 2.0.0 Release: 1%{?dist} Summary: Manipulate and transform HTML/XML documents and fragments Group: Development/Languages @@ -11,16 +11,23 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # Tests fail with newer libxml. # https://github.com/flavorjones/loofah/issues/60 Patch0: rubygem-loofah-1.2.1-skip-test.patch +# Tests fail when run outside Rake/Hoe. +# https://github.com/flavorjones/loofah/pull/74 +Patch1: rubygem-loofah-2.0.0-tests-rr.patch +%if 0%{?fc19} || 0%{?fc20} || 0%{?el7} Requires: ruby(release) Requires: ruby(rubygems) -Requires: rubygem(nokogiri) >= 1.4.4 +Requires: rubygem(nokogiri) >= 1.5.9 +%endif BuildRequires: ruby(release) BuildRequires: rubygems-devel -BuildRequires: rubygem(nokogiri) >= 1.4.4 +BuildRequires: rubygem(nokogiri) >= 1.5.9 BuildRequires: rubygem(minitest) BuildRequires: rubygem(rr) BuildArch: noarch +%if 0%{?fc19} || 0%{?fc20} || 0%{?el7} Provides: rubygem(%{gem_name}) = %{version} +%endif %description Loofah is a general library for manipulating and transforming HTML/XML @@ -55,6 +62,9 @@ done # Tests fail with newer libxml. # https://github.com/flavorjones/loofah/issues/60 %patch0 -p 1 +# Tests fail when run outside Rake/Hoe. +# https://github.com/flavorjones/loofah/pull/74 +%patch1 -p 1 %build # Create the gem as gem install only works on a gem file @@ -69,7 +79,8 @@ cp -pa .%{gem_dir}/* \ %check pushd .%{gem_instdir} - testrb -Ilib:test test/*/test_*.rb + ruby -I"lib:test" -e \ + 'Dir.glob "./test/**/test_*.rb", &method(:require)' popd @@ -89,5 +100,9 @@ popd %exclude %{gem_instdir}/test %changelog +* Mon May 12 2014 Ken Dreyer - 2.0.0-1 +- Update to loofah 2.0.0 (RHBZ #1096760) +- Adjustments for https://fedoraproject.org/wiki/Changes/Ruby_2.1 + * Sat Dec 28 2013 Ken Dreyer - 1.2.1-1 - Initial package diff --git a/sources b/sources index 3af1513..b293088 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a684fd067bb870d46d493ea8be832ebd loofah-1.2.1.gem +4f46e7d75b2d6038a69a14c1dca97dfc loofah-2.0.0.gem