From d9db850082b91d8e1263665f9fc61fa292c57138 Mon Sep 17 00:00:00 2001 From: Derek Prior Date: Fri, 17 May 2013 11:17:21 -0400 Subject: [PATCH] Fix route_matcher specs in Rails 4 The rails assertion that underlies the `route_matcher` matcher has changed in Rails 4 to depend on the `message` method from MiniTest. RSpec is smart enough to make that method available, but only for controller and routing specs (and only in 2.13.1+). I marked the `route_matcher` specs as controller specs and updated the rspec-rails gem development dependency to 2.13.1 or later (but less than 3). --- Gemfile.lock | 6 +++--- gemfiles/3.0.gemfile.lock | 6 +++--- gemfiles/3.1.gemfile.lock | 6 +++--- gemfiles/3.2.gemfile.lock | 6 +++--- gemfiles/4.0.gemfile.lock | 2 +- shoulda-matchers.gemspec | 2 +- .../matchers/action_controller/route_matcher_spec.rb | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 636a861e..5b2037ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -99,8 +99,8 @@ GEM rspec-core (2.13.1) rspec-expectations (2.13.0) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.0) - rspec-rails (2.13.0) + rspec-mocks (2.13.1) + rspec-rails (2.13.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -136,7 +136,7 @@ DEPENDENCIES jruby-openssl rails (~> 3.0) rake (>= 0.9.2) - rspec-rails (~> 2.13) + rspec-rails (>= 2.13.1, < 3) shoulda-context (~> 1.1.2) shoulda-matchers! sqlite3 diff --git a/gemfiles/3.0.gemfile.lock b/gemfiles/3.0.gemfile.lock index ce495e8e..9a102d7d 100644 --- a/gemfiles/3.0.gemfile.lock +++ b/gemfiles/3.0.gemfile.lock @@ -96,8 +96,8 @@ GEM rspec-core (2.13.1) rspec-expectations (2.13.0) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.0) - rspec-rails (2.13.0) + rspec-mocks (2.13.1) + rspec-rails (2.13.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -131,7 +131,7 @@ DEPENDENCIES jruby-openssl rails (~> 3.0.17) rake (>= 0.9.2) - rspec-rails (~> 2.13) + rspec-rails (>= 2.13.1, < 3) shoulda-context (~> 1.1.2) shoulda-matchers! sqlite3 diff --git a/gemfiles/3.1.gemfile.lock b/gemfiles/3.1.gemfile.lock index 810f3d21..99010e24 100644 --- a/gemfiles/3.1.gemfile.lock +++ b/gemfiles/3.1.gemfile.lock @@ -104,8 +104,8 @@ GEM rspec-core (2.13.1) rspec-expectations (2.13.0) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.0) - rspec-rails (2.13.0) + rspec-mocks (2.13.1) + rspec-rails (2.13.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -151,7 +151,7 @@ DEPENDENCIES jruby-openssl rails (~> 3.1.8) rake (>= 0.9.2) - rspec-rails (~> 2.13) + rspec-rails (>= 2.13.1, < 3) sass-rails shoulda-context (~> 1.1.2) shoulda-matchers! diff --git a/gemfiles/3.2.gemfile.lock b/gemfiles/3.2.gemfile.lock index f54f97f3..fb37d417 100644 --- a/gemfiles/3.2.gemfile.lock +++ b/gemfiles/3.2.gemfile.lock @@ -102,8 +102,8 @@ GEM rspec-core (2.13.1) rspec-expectations (2.13.0) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.13.0) - rspec-rails (2.13.0) + rspec-mocks (2.13.1) + rspec-rails (2.13.2) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) @@ -149,7 +149,7 @@ DEPENDENCIES jruby-openssl rails (~> 3.2.13) rake (>= 0.9.2) - rspec-rails (~> 2.13) + rspec-rails (>= 2.13.1, < 3) sass-rails shoulda-context (~> 1.1.2) shoulda-matchers! diff --git a/gemfiles/4.0.gemfile.lock b/gemfiles/4.0.gemfile.lock index 0b037fd3..e24851be 100644 --- a/gemfiles/4.0.gemfile.lock +++ b/gemfiles/4.0.gemfile.lock @@ -144,7 +144,7 @@ DEPENDENCIES protected_attributes rails (= 4.0.0) rake (>= 0.9.2) - rspec-rails (~> 2.13) + rspec-rails (>= 2.13.1, < 3) sass-rails (~> 4.0.0) shoulda-context (~> 1.1.2) shoulda-matchers! diff --git a/shoulda-matchers.gemspec b/shoulda-matchers.gemspec index c04a69b4..fbc0f7e8 100644 --- a/shoulda-matchers.gemspec +++ b/shoulda-matchers.gemspec @@ -28,5 +28,5 @@ Gem::Specification.new do |s| s.add_development_dependency('cucumber', '~> 1.1') s.add_development_dependency('rails', '~> 3.0') s.add_development_dependency('rake', '>= 0.9.2') - s.add_development_dependency('rspec-rails', '~> 2.13') + s.add_development_dependency('rspec-rails', '>= 2.13.1', '< 3') end diff --git a/spec/shoulda/matchers/action_controller/route_matcher_spec.rb b/spec/shoulda/matchers/action_controller/route_matcher_spec.rb index a9aaeed0..2c3cd63a 100644 --- a/spec/shoulda/matchers/action_controller/route_matcher_spec.rb +++ b/spec/shoulda/matchers/action_controller/route_matcher_spec.rb @@ -1,6 +1,6 @@ require 'spec_helper' -describe Shoulda::Matchers::ActionController::RouteMatcher do +describe Shoulda::Matchers::ActionController::RouteMatcher, type: :controller do context 'given a controller with a defined glob url' do it 'accepts glob route' do controller = define_controller('Examples').new