1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[bundler/bundler] Add required_ruby_version to gemspec template

https://github.com/bundler/bundler/commit/f47421f92d
This commit is contained in:
Miklos Fazekas 2016-03-26 11:47:43 +01:00 committed by Hiroshi SHIBATA
parent b014a2157f
commit a12557dbfd
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
2 changed files with 7 additions and 0 deletions

View file

@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
<%- if config[:mit] -%> <%- if config[:mit] -%>
spec.license = "MIT" spec.license = "MIT"
<%- end -%> <%- end -%>
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'" spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"

View file

@ -274,6 +274,12 @@ RSpec.describe "bundle gem" do
to match(/mygemserver\.com/) to match(/mygemserver\.com/)
end end
it "sets a minimum ruby version" do
bundler_gemspec = Bundler::GemHelper.new(File.expand_path("../..", __dir__)).gemspec
expect(bundler_gemspec.required_ruby_version).to eq(generated_gemspec.required_ruby_version)
end
it "requires the version file" do it "requires the version file" do
expect(bundled_app("test_gem/lib/test_gem.rb").read).to match(%r{require "test_gem/version"}) expect(bundled_app("test_gem/lib/test_gem.rb").read).to match(%r{require "test_gem/version"})
end end