[rubygem-shoulda] Update to Shoulda 3.5.0.

Vít Ondruch vondruch at fedoraproject.org
Mon Jul 7 12:43:20 UTC 2014


commit 0c20aab3996e3b3a1289aa669655079b73cabfc3
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Mon Jul 7 14:43:30 2014 +0200

    Update to Shoulda 3.5.0.

 .gitignore                             |    1 +
 rubygem-shoulda-3.5.0-test-fixes.patch |   92 +++++++++++++++++++++++
 rubygem-shoulda-init.rb                |    1 -
 rubygem-shoulda-tasks_shoulda.rake     |    1 -
 rubygem-shoulda.spec                   |  127 +++++++++++++-------------------
 sources                                |    2 +-
 6 files changed, 145 insertions(+), 79 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 0d4c056..2e792b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 shoulda-2.10.2.gem
 shoulda-2.11.3.gem
+/shoulda-3.5.0.gem
diff --git a/rubygem-shoulda-3.5.0-test-fixes.patch b/rubygem-shoulda-3.5.0-test-fixes.patch
new file mode 100644
index 0000000..da8904d
--- /dev/null
+++ b/rubygem-shoulda-3.5.0-test-fixes.patch
@@ -0,0 +1,92 @@
+diff --git a/features/rails_integration.feature b/features/rails_integration.feature
+index 900066a..e4c46be 100644
+--- a/features/rails_integration.feature
++++ b/features/rails_integration.feature
+@@ -13,7 +13,7 @@ Feature: integrate with Rails
+         end
+       end
+       """
+-    When I successfully run `bundle exec rake db:migrate --trace`
++    When I successfully run `bundle exec rake db:migrate --trace RAILS_ENV=test`
+     And I write to "app/models/user.rb" with:
+       """
+       class User < ActiveRecord::Base
+@@ -51,14 +51,13 @@ Feature: integrate with Rails
+         end
+ 
+         should respond_with(:success)
+-        should assign_to(:example)
++        should_not render_with_layout
+       end
+       """
+     When I successfully run `bundle exec rake test TESTOPTS='-v' --trace`
+-    Then the output should contain "1 tests, 1 assertions, 0 failures, 0 errors"
+-    And the output should contain "2 tests, 2 assertions, 0 failures, 0 errors"
++    Then the output should contain "3 runs, 3 assertions, 0 failures, 0 errors, 0 skips"
+     And the output should contain "User should require name to be set"
+-    And the output should contain "ExamplesController should assign @example"
++    And the output should contain "ExamplesController should not render with a layout"
+ 
+   Scenario: generate a rails application and use matchers in Rspec
+     When I configure the application to use rspec-rails
+@@ -78,10 +77,12 @@ Feature: integrate with Rails
+ 
+       describe ExamplesController, "show" do
+         before { get :show }
+-        it { should assign_to(:example) }
++        it { should respond_with(:success) }
++        it { should_not render_with_layout }
+       end
+       """
+     When I successfully run `bundle exec rake spec SPEC_OPTS=-fs --trace`
+-    Then the output should contain "2 examples, 0 failures"
++    Then the output should contain "3 examples, 0 failures"
+     And the output should contain "should require name to be set"
+-    And the output should contain "should assign @example"
++    And the output should contain "should respond with 200"
++    And the output should contain "should not render with a layout"
+diff --git a/features/step_definitions/rails_steps.rb b/features/step_definitions/rails_steps.rb
+index f1cf4c3..bc910bf 100644
+--- a/features/step_definitions/rails_steps.rb
++++ b/features/step_definitions/rails_steps.rb
+@@ -3,12 +3,12 @@ APP_NAME     = 'testapp'.freeze
+ 
+ When /^I generate a new rails application$/ do
+   steps %{
+-    When I run `bundle exec rails new #{APP_NAME}`
++    When I run `rails new #{APP_NAME} -B`
+     And I cd to "#{APP_NAME}"
+     And I write to "Gemfile" with:
+       """
+       source "http://rubygems.org"
+-      gem 'rails', '3.0.12'
++      gem 'rails'
+       gem 'sqlite3'
+       """
+     And I successfully run `bundle install --local`
+@@ -37,14 +37,14 @@ When /^I configure the application to use shoulda-context$/ do
+ end
+ 
+ When /^I configure the application to use shoulda$/ do
+-  append_to_gemfile "gem 'shoulda-matchers', '~> 1.0', :require => false"
++  append_to_gemfile "gem 'shoulda-matchers', :require => false"
+   append_to_gemfile "gem 'shoulda-context', '~> 1.0', :require => false"
+   append_to_gemfile "gem 'shoulda', :path => '../../..'"
+   steps %{And I run `bundle install --local`}
+ end
+ 
+ When /^I configure the application to use shoulda-matchers$/ do
+-  append_to_gemfile "gem 'shoulda-matchers', '~> 1.0'"
++  append_to_gemfile "gem 'shoulda-matchers'"
+   steps %{And I run `bundle install --local`}
+ end
+ 
+@@ -53,7 +53,7 @@ When /^I configure a wildcard route$/ do
+     When I write to "config/routes.rb" with:
+     """
+     Rails.application.routes.draw do
+-      match ':controller(/:action(/:id(.:format)))'
++      get ':controller(/:action(/:id(.:format)))'
+     end
+     """
+   }
diff --git a/rubygem-shoulda.spec b/rubygem-shoulda.spec
index 6956b75..565819f 100644
--- a/rubygem-shoulda.spec
+++ b/rubygem-shoulda.spec
@@ -1,45 +1,37 @@
+# Generated from shoulda-3.5.0.gem by gem2rpm -*- rpm-spec -*-
 %global gem_name shoulda
-%global railsver %(gem list rails | grep rails | cut -d\\( -f2 | cut -d\\) -f1 | head -1 )
 
-Summary: Making tests easy on the fingers and eyes
 Name: rubygem-%{gem_name}
-Version: 2.11.3
-Release: 9%{?dist}
+Version: 3.5.0
+Release: 1%{?dist}
+Summary: Making tests easy on the fingers and eyes
 Group: Development/Languages
 License: MIT
-URL: http://thoughtbot.com/community/
-Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem
-# The following files are needed for testing, but are not part of the
-# distribution. Here's how you obtain these files:
-# 
-# git clone git://github.com/thoughtbot/shoulda.git
-# cd shoulda
-# git checkout v2.11.3 # the version 
-# cp tasks/shoulda.rake /path/to/SOURCES/rubygem-shoulda-tasks_shoulda.rake
-# cp init.rb /path/to/SOURCES/rubygem-shoulda-init.rb
-Source1:        rubygem-shoulda-tasks_shoulda.rake
-Source2:        rubygem-shoulda-init.rb
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-Requires: ruby(rubygems)
-Requires: ruby(release)
+URL: https://github.com/thoughtbot/shoulda
+Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
+# Fix test suite to work with Rails 4.1 and locally installed gems.
+Patch0: rubygem-shoulda-3.5.0-test-fixes.patch
+BuildRequires: ruby(release)
 BuildRequires: rubygems-devel
-BuildRequires: dos2unix
+BuildRequires: ruby
+BuildRequires: rubygem(aruba)
 BuildRequires: rubygem(cucumber)
-BuildRequires: rubygem(rake)
 BuildRequires: rubygem(rails)
+BuildRequires: rubygem(shoulda-context)
+BuildRequires: rubygem(shoulda-matchers)
 BuildRequires: rubygem(sqlite3)
-BuildRequires: rubygem(mocha)
+BuildRequires: rubygem(rspec-rails)
 BuildArch: noarch
-Provides: rubygem(%{gem_name}) = %{version}
 
 %description
-Making tests easy on the fingers and eyes
+Making tests easy on the fingers and eyes.
+
 
 %package doc
-Summary:           Documentation for %{name}
-Group:             Documentation
-Requires:          %{name} = %{version}-%{release}
+Summary: Documentation for %{name}
+Group: Documentation
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
 
 %description doc
 Documentation for %{name}.
@@ -50,76 +42,59 @@ Documentation for %{name}.
 %setup -q -c -T
 %gem_install -n %{SOURCE0}
 
+pushd .%{gem_instdir}
+%patch0 -p1
+popd
+
 %build
 
 %install
 mkdir -p %{buildroot}%{gem_dir}
-cp -pa .%{gem_dir}/* \
+cp -a .%{gem_dir}/* \
         %{buildroot}%{gem_dir}/
 
+# Fix wrong-file-end-of-line-encoding for rpmlint.
+sed -i 's/\r$//' %{buildroot}%{gem_instdir}/MIT-LICENSE
 
-mkdir -p %{buildroot}%{_bindir}
-cp -pa .%{_bindir}/* \
-        %{buildroot}%{_bindir}/
-
-find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
-
-# Notified upstream of lack of ability to run tests after running gem install 
-#  on Sep 03, 2010.  Not holding my breath.
-
-# This task is not part of the distribution but is required for rake test in %%check
-mkdir -p %{buildroot}%{gem_instdir}/tasks
-cp -a -p %{SOURCE1} %{buildroot}%{gem_instdir}/tasks/%{gem_name}.rake
-# This is also not part of dist gem, but needed for tests
-cp -a -p %{SOURCE2} %{buildroot}%{gem_instdir}/init.rb
-# This is also not part of dist gem, but needed for tests
-cp -a -p %{buildroot}/%{gem_dir}/specifications/* %{buildroot}%{gem_instdir}/shoulda.gemspec
 
-# environment.rb set to use a static Rails version -- it's not pretty, but it works
-echo 'RAILS_GEM_VERSION="%{railsver}" '  >  %{buildroot}%{gem_instdir}/test/rails2_root/config/environment.tmp.rb
-cat %{buildroot}%{gem_instdir}/test/rails2_root/config/environment.rb >> %{buildroot}%{gem_instdir}/test/rails2_root/config/environment.tmp.rb
-mv -f  %{buildroot}%{gem_instdir}/test/rails2_root/config/environment.tmp.rb %{buildroot}%{gem_instdir}/test/rails2_root/config/environment.rb
+# Run the test suite
+%check
+cp .%{gem_spec} .%{gem_instdir}/shoulda.gemspec
 
-# Fix end-of-line encoding
-dos2unix %{buildroot}/%{gem_instdir}/MIT-LICENSE
+pushd .%{gem_instdir}
 
+# Relax version dependencies.
+sed -i -r 's/(dependency\(%q<.*>), \[".*"\]/\1/' shoulda.gemspec
 
+# Drop useless dependency.
+sed -i '/appraisal/d' shoulda.gemspec
 
-%clean
-rm -rf %{buildroot}
-
-%check 
-pushd %{buildroot}%{gem_instdir}
-# TODO: run when new version comes out
-# (tests of this version only work with rails 2.x.x)
-#rake test
+cucumber
 popd
 
 %files
-%defattr(-, root, root, -)
-%{_bindir}/convert_to_should_syntax
-%dir %{gem_instdir}
-%doc %{gem_instdir}/README.rdoc
 %doc %{gem_instdir}/MIT-LICENSE
-%{gem_cache}
-%{gem_spec}
+%dir %{gem_instdir}
+%exclude %{gem_instdir}/.*
 %{gem_libdir}
-%{gem_instdir}/bin
-%{gem_instdir}/rails
+%exclude %{gem_cache}
+%{gem_spec}
 
 %files doc
-%defattr(-, root, root, -)
-%{gem_instdir}/tasks
-%{gem_instdir}/init.rb
-%{gem_instdir}/*.gemspec
-%{gem_docdir}
-%{gem_instdir}/CONTRIBUTION_GUIDELINES.rdoc
-%{gem_instdir}/test
+%doc %{gem_docdir}
+%{gem_instdir}/Appraisals
+%doc %{gem_instdir}/CONTRIBUTING.md
+%{gem_instdir}/Gemfile
+%doc %{gem_instdir}/README.md
 %{gem_instdir}/Rakefile
-
-
+%{gem_instdir}/features
+%{gem_instdir}/gemfiles
+%{gem_instdir}/shoulda.gemspec
 
 %changelog
+* Thu Jun 26 2014 Vít Ondruch <vondruch at redhat.com> - 3.5.0-1
+- Update to Shoulda 3.5.0.
+
 * Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.11.3-9
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
 
diff --git a/sources b/sources
index 70ba496..e1e1879 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ca0b3d188a6e4bc3a39731b182fa8efb  shoulda-2.11.3.gem
+a6b1c7be5f2674661edfbb04989035a3  shoulda-3.5.0.gem


More information about the scm-commits mailing list