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:
parent
b014a2157f
commit
a12557dbfd
2 changed files with 7 additions and 0 deletions
|
@ -12,6 +12,7 @@ Gem::Specification.new do |spec|
|
|||
<%- if config[:mit] -%>
|
||||
spec.license = "MIT"
|
||||
<%- end -%>
|
||||
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
||||
|
||||
spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
||||
|
||||
|
|
|
@ -274,6 +274,12 @@ RSpec.describe "bundle gem" do
|
|||
to match(/mygemserver\.com/)
|
||||
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
|
||||
expect(bundled_app("test_gem/lib/test_gem.rb").read).to match(%r{require "test_gem/version"})
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue