Skip to content

Commit

Permalink
Tests: Explicitly specify rails as a dev. dependency
Browse files Browse the repository at this point in the history
spec/dummy_app needs rails. Technically, it only needs actionpack,
but in case that changes in the future, I think we should just
have rails as an explicit dependency.

You may ask, if dummy_app has always needed actionpack, and our
gemspec didn't explicitly specify the later, how did it ever work?
It looks like we were getting actionpack as a transitive dependency.
  • Loading branch information
jaredbeck committed Dec 14, 2020
1 parent 329ae89 commit d9474bd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
7 changes: 4 additions & 3 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
# > appraisal. If something is specified in both the Gemfile and an appraisal,
# > the version from the appraisal takes precedence.
# > https://github.com/thoughtbot/appraisal

#
#
appraise "ar-5.2" do
gem "activerecord", "~> 5.2.4"
gem "rails", "~> 5.2.4"
gem "rails-controller-testing", "~> 1.0.2"
end

appraise "ar-6.0" do
gem "activerecord", "~> 6.0.3"
gem "rails", "~> 6.0.3"
gem "rails-controller-testing", "~> 1.0.3"
end
2 changes: 1 addition & 1 deletion gemfiles/ar_5.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~> 5.2.4"
gem "rails", "~> 5.2.4"
gem "rails-controller-testing", "~> 1.0.2"

gemspec path: "../"
2 changes: 1 addition & 1 deletion gemfiles/ar_6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~> 6.0.3"
gem "rails", "~> 6.0.3"
gem "rails-controller-testing", "~> 1.0.3"

gemspec path: "../"
8 changes: 7 additions & 1 deletion paper_trail.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ has been destroyed.
# https://www.ruby-lang.org/en/news/2019/10/02/ruby-2-4-9-released/
s.required_ruby_version = ">= 2.4.0"

# We no longer specify a maximum rails version.
# We no longer specify a maximum activerecord version.
# See discussion in paper_trail/compatibility.rb
s.add_dependency "activerecord", ::PaperTrail::Compatibility::ACTIVERECORD_GTE
s.add_dependency "request_store", "~> 1.1"
Expand All @@ -41,6 +41,12 @@ has been destroyed.
s.add_development_dependency "ffaker", "~> 2.11"
s.add_development_dependency "generator_spec", "~> 0.9.4"
s.add_development_dependency "memory_profiler", "~> 0.9.14"

# For `spec/dummy_app`. Technically, we only need `actionpack` (as of 2020).
# However, that might change in the future, and the advantages of specifying a
# subset (e.g. actionpack only) are unclear.
s.add_development_dependency "rails", ::PaperTrail::Compatibility::ACTIVERECORD_GTE

s.add_development_dependency "rake", "~> 13.0"
s.add_development_dependency "rspec-rails", "~> 4.0"
s.add_development_dependency "rubocop", "~> 0.89.1"
Expand Down

0 comments on commit d9474bd

Please sign in to comment.