Skip to content

Commit

Permalink
spec: Test that require-ing 'railtie' would not cause errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ribose-jeffreylau committed Mar 11, 2019
1 parent dab53f3 commit e4e6842
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ source "http://rubygems.org"

# Specify your gem's dependencies in activeuuid.gemspec
gemspec
gem "activerecord", "~>5.0"

rails_version = "~>5.0"
gem "activerecord", rails_version
gem "rake", "< 11.0"

gem "codecov", require: false, group: :test
gem "railties", rails_version, require: false, group: :test
gem "simplecov", require: false, group: :test
4 changes: 3 additions & 1 deletion gemfiles/Rails-5_0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ source "http://rubygems.org"

gemspec path: "../"

gem "activerecord", "~> 5.0.0"
rails_version = "~> 5.0.0"
gem "activerecord", rails_version

gem "codecov", require: false, group: :test
gem "railties", rails_version, require: false, group: :test
gem "simplecov", require: false, group: :test
4 changes: 3 additions & 1 deletion gemfiles/Rails-5_1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ source "http://rubygems.org"

gemspec path: "../"

gem "activerecord", "~> 5.1.0"
rails_version = "~> 5.1.0"
gem "activerecord", rails_version

gem "codecov", require: false, group: :test
gem "railties", rails_version, require: false, group: :test
gem "simplecov", require: false, group: :test
4 changes: 3 additions & 1 deletion gemfiles/Rails-5_2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ source "http://rubygems.org"

gemspec path: "../"

gem "activerecord", "~> 5.2.0"
rails_version = "~> 5.2.0"
gem "activerecord", rails_version

gem "codecov", require: false, group: :test
gem "railties", rails_version, require: false, group: :test
gem "simplecov", require: false, group: :test
1 change: 1 addition & 0 deletions gemfiles/Rails-head.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ gemspec path: "../"
gem "activerecord", github: "rails/rails"

gem "codecov", require: false, group: :test
gem "railties", github: "rails/rails", require: false, group: :test
gem "simplecov", require: false, group: :test
11 changes: 11 additions & 0 deletions spec/integration/railtie_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "spec_helper"

RSpec.describe "railtie" do
it "does not raise error on #require" do
action = -> {
require "rails"
require "active_uuid/railtie"
}
expect(action).to_not raise_error
end
end

0 comments on commit e4e6842

Please sign in to comment.