diff --git a/.gitignore b/.gitignore index 8aec07d..a551f95 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ mocha-0.9.7.gem /mocha-0.11.0.gem /mocha-0.12.1.gem /mocha-0.13.1.gem +/mocha-0.14.0.gem diff --git a/rubygem-mocha-0.14.0-test-helper-mocha-setup.patch b/rubygem-mocha-0.14.0-test-helper-mocha-setup.patch new file mode 100644 index 0000000..d0f795a --- /dev/null +++ b/rubygem-mocha-0.14.0-test-helper-mocha-setup.patch @@ -0,0 +1,28 @@ +commit e4a88348dde432201611292802537b590d6734ea +Author: Ken Dreyer +Date: Sat Jul 27 21:19:53 2013 -0600 + + require "mocha/setup" in test_helper + + We must require mocha/setup before referring to classes named "Mocha". + +diff --git a/test/test_helper.rb b/test/test_helper.rb +index 092ac73..047288b 100644 +--- a/test/test_helper.rb ++++ b/test/test_helper.rb +@@ -23,6 +23,7 @@ if defined?(::Minitest) || defined?(MiniTest) + rescue LoadError + MiniTest::Unit.autorun + end ++ require 'mocha/setup' + class Mocha::TestCase < defined?(Minitest::Test) ? Minitest::Test : MiniTest::Unit::TestCase + def assert_nothing_raised(exception = StandardError) + yield +@@ -37,6 +38,7 @@ if defined?(::Minitest) || defined?(MiniTest) + end + else + require 'test/unit' ++ require 'mocha/setup' + class Mocha::TestCase < Test::Unit::TestCase + def test_dummy + # Some versions (?) of Test::Unit try to run this base class as a test case diff --git a/rubygem-mocha.spec b/rubygem-mocha.spec index cb393ef..d715fe2 100644 --- a/rubygem-mocha.spec +++ b/rubygem-mocha.spec @@ -3,12 +3,15 @@ Summary: Mocking and stubbing library Name: rubygem-%{gem_name} -Version: 0.13.1 -Release: 4%{?dist} +Version: 0.14.0 +Release: 1%{?dist} Group: Development/Languages License: MIT and Ruby URL: http://mocha.rubyforge.org Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem +# Make the tests work outside of rake/bundler +# https://github.com/freerange/mocha/pull/163 +Patch0: rubygem-mocha-0.14.0-test-helper-mocha-setup.patch Requires: ruby(release) Requires: ruby(rubygems) Requires: rubygem(metaclass) @@ -39,6 +42,10 @@ This package contains documentation for %{name}. %setup -q -c -T %gem_install -n %{SOURCE0} +pushd .%{gem_instdir} +%patch0 -p1 +popd + %build %install @@ -50,8 +57,7 @@ cp -pa .%{gem_dir}/* \ pushd %{buildroot}%{gem_instdir} # Each part of test suite must be run separately, otherwise the test suite fails. # https://github.com/freerange/mocha/issues/121 -ruby -e "Dir.glob('./test/unit/**/*_test.rb').each {|t| require t}" -ruby -e "Dir.glob('./test/acceptance/**/*_test.rb').each {|t| require t}" +ruby -e "Dir.glob('./test/{unit,acceptance}/**/*_test.rb').each {|t| require t}" ruby -e "Dir.glob('./test/integration/**/*_test.rb').each {|t| require t}" popd @@ -75,9 +81,15 @@ popd %{gem_instdir}/mocha.gemspec %{gem_instdir}/gemfiles/ %{gem_instdir}/test/ +%{gem_instdir}/yard-templates/ %changelog +* Thu Aug 15 2013 Ken Dreyer - 0.14.0-1 +- Update to 0.14.0 +- Run unit and acceptance tests in a single process +- Patch test suite to work outside rake/bundler + * Sun Aug 04 2013 Fedora Release Engineering - 0.13.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild diff --git a/sources b/sources index 086b373..b168639 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -bfcb1a14b902d9e77e8b341b9a3ac186 mocha-0.13.1.gem +c2ab792c0a505b41999736510cae63cf mocha-0.14.0.gem