-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit is long overdue. The main change is to upgrade shoulda's hard dependency on shoulda-matchers from 2.x to 3.x. Since this by itself is a pretty consequential change, though, I also took the opportunity to make some more at the same time that I think are reasonable: * Remove support for Rails 3, Rails 4.0, and Rails 4.1, since they have been end-of-lifed; support Rails 4.2-5.0 instead. * Remove support for Ruby 1.9 and 2.0; support Ruby 2.1-2.4 instead. * Remove support for RSpec, along with related Cucumber specs. People who use RSpec won't be using the `shoulda` gem -- they'll be using `shoulda-matchers` instead. There's already a good collection of integration specs there, so we don't need the tests here. Please note that we are using the Rails Git repo to refer to 4.2 because the latest release of 4.2 isn't compatible with Ruby 2.4 just yet (but it's fixed on the 4-2-stable branch).
- Loading branch information
Showing
13 changed files
with
478 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,6 @@ | |
Gemfile.lock | ||
coverage | ||
doc | ||
gemfiles | ||
pkg | ||
tags | ||
test/*/log/*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
language: ruby | ||
sudo: false | ||
cache: bundler | ||
script: "bundle exec rake" | ||
rvm: | ||
- 1.9.3 | ||
- 2.0.0 | ||
- 2.1 | ||
- 2.2 | ||
|
||
- 2.2.6 | ||
- 2.3.3 | ||
- 2.4.0 | ||
gemfile: | ||
- gemfiles/4.2.gemfile | ||
- gemfiles/5.0.gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
appraise '3.0' do | ||
gem 'rails', '3.0.12' | ||
shared_dependencies = proc do | ||
gem 'listen' | ||
gem 'sass-rails' | ||
gem 'sqlite3' | ||
gem 'rspec', '~> 3.0' | ||
gem 'shoulda-context' | ||
gem 'shoulda-matchers', '~> 3.0' | ||
end | ||
|
||
appraise '3.1' do | ||
gem 'rails', '3.1.4' | ||
gem 'jquery-rails' | ||
gem 'sass-rails' | ||
appraise '4.2' do | ||
instance_eval(&shared_dependencies) | ||
gem 'rails', git: 'https://github.com/rails/rails.git', branch: '4-2-stable' | ||
end | ||
|
||
appraise '3.2' do | ||
gem 'rails', '3.2.3' | ||
gem 'jquery-rails' | ||
gem 'sass-rails' | ||
appraise '5.0' do | ||
instance_eval(&shared_dependencies) | ||
gem 'rails', '5.0.1' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
gem 'appraisal', '~> 2.1' | ||
gem 'rails', '>= 4.2', '< 6' | ||
gem 'sqlite3', '~> 1.3.11' | ||
gem 'rspec', '~> 3.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,67 @@ | ||
PROJECT_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..')).freeze | ||
APP_NAME = 'testapp'.freeze | ||
|
||
When /^I generate a new rails application$/ do | ||
When 'I generate a new Rails application' do | ||
steps %{ | ||
When I run `bundle exec rails new #{APP_NAME}` | ||
When I run `bundle exec rails new #{APP_NAME} --skip-bundle --no-rc` | ||
And I cd to "#{APP_NAME}" | ||
And I write to "Gemfile" with: | ||
""" | ||
source "http://rubygems.org" | ||
gem 'rails', '3.0.12' | ||
source 'https://rubygems.org' | ||
gem 'rails', '#{rails_version}' | ||
gem 'sqlite3' | ||
""" | ||
And I successfully run `bundle install --local` | ||
} | ||
end | ||
|
||
When /^I configure the application to use "([^\"]+)" from this project$/ do |name| | ||
append_to_gemfile "gem '#{name}', :path => '#{PROJECT_ROOT}'" | ||
append_to_gemfile "gem '#{name}', path: '#{PROJECT_ROOT}'" | ||
steps %{And I run `bundle install --local`} | ||
end | ||
|
||
When /^I run the rspec generator$/ do | ||
steps %{ | ||
When I successfully run `rails generate rspec:install` | ||
} | ||
end | ||
|
||
When /^I configure the application to use rspec\-rails$/ do | ||
append_to_gemfile "gem 'rspec-rails'" | ||
When 'I configure the application to use Shoulda' do | ||
append_to_gemfile "gem 'shoulda', path: '../../..'" | ||
steps %{And I run `bundle install --local`} | ||
end | ||
|
||
When /^I configure the application to use shoulda-context$/ do | ||
append_to_gemfile "gem 'shoulda-context'" | ||
steps %{And I run `bundle install --local`} | ||
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-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'" | ||
steps %{And I run `bundle install --local`} | ||
append_to 'test/test_helper.rb', <<-TEXT | ||
Shoulda::Matchers.configure do |config| | ||
config.integrate do |with| | ||
with.test_framework :minitest | ||
with.library :rails | ||
end | ||
end | ||
TEXT | ||
end | ||
|
||
When /^I configure a wildcard route$/ do | ||
When 'I configure a wildcard route' do | ||
steps %{ | ||
When I write to "config/routes.rb" with: | ||
""" | ||
Rails.application.routes.draw do | ||
match ':controller(/:action(/:id(.:format)))' | ||
get ':controller(/:action(/:id(.:format)))' | ||
end | ||
""" | ||
} | ||
end | ||
|
||
module AppendHelpers | ||
def append_to(path, contents) | ||
in_current_dir do | ||
File.open(path, "a") do |file| | ||
file.puts | ||
file.puts contents | ||
end | ||
end | ||
end | ||
When 'I successfully run the "test" task' do | ||
steps %{ | ||
When I successfully run `bundle exec rake test TESTOPTS='-v' --trace` | ||
} | ||
end | ||
|
||
def append_to_gemfile(contents) | ||
append_to('Gemfile', contents) | ||
Then /^the output should indicate that (\d+) tests were run successfully$/ do |number| | ||
if rails_gte_4_1? | ||
steps %{ | ||
Then the output should contain: | ||
""" | ||
#{number} runs, #{number} assertions, 0 failures, 0 errors | ||
""" | ||
} | ||
else | ||
steps %{ | ||
Then the output should contain: | ||
""" | ||
#{number} tests, #{number} assertions, 0 failures, 0 errors | ||
""" | ||
} | ||
end | ||
end | ||
|
||
World(AppendHelpers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "appraisal", "~> 2.1" | ||
gem "rails", :git => "https://github.com/rails/rails.git", :branch => "4-2-stable" | ||
gem "sqlite3" | ||
gem "rspec", "~> 3.0" | ||
gem "listen" | ||
gem "sass-rails" | ||
gem "shoulda-context" | ||
gem "shoulda-matchers", "~> 3.0" |
Oops, something went wrong.