зеркало из https://github.com/github/ruby.git
[bundler/bundler] Generate new gem development dependencies in Gemfile
https://github.com/bundler/bundler/commit/02177d0e10
This commit is contained in:
Родитель
86757abd25
Коммит
bdcd1990ad
|
@ -2,3 +2,11 @@ source "https://rubygems.org"
|
|||
|
||||
# Specify your gem's dependencies in <%= config[:name] %>.gemspec
|
||||
gemspec
|
||||
|
||||
gem "rake", "~> 12.0"
|
||||
<%- if config[:ext] -%>
|
||||
gem "rake-compiler"
|
||||
<%- end -%>
|
||||
<%- if config[:test] -%>
|
||||
gem "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
||||
<%- end -%>
|
||||
|
|
|
@ -33,11 +33,4 @@ Gem::Specification.new do |spec|
|
|||
<%- end -%>
|
||||
|
||||
spec.add_development_dependency "bundler", "~> <%= config[:bundler_version] %>"
|
||||
spec.add_development_dependency "rake", "~> 12.0"
|
||||
<%- if config[:ext] -%>
|
||||
spec.add_development_dependency "rake-compiler"
|
||||
<%- end -%>
|
||||
<%- if config[:test] -%>
|
||||
spec.add_development_dependency "<%= config[:test] %>", "~> <%= config[:test_framework_version] %>"
|
||||
<%- end -%>
|
||||
end
|
||||
|
|
|
@ -363,9 +363,14 @@ RSpec.describe "bundle gem" do
|
|||
expect(bundled_app("test_gem/spec/spec_helper.rb")).to exist
|
||||
end
|
||||
|
||||
it "depends on a specific version of rspec" do
|
||||
rspec_dep = generated_gemspec.development_dependencies.find {|d| d.name == "rspec" }
|
||||
expect(rspec_dep).to be_specific
|
||||
it "depends on a specific version of rspec in generated Gemfile" do
|
||||
Dir.chdir(bundled_app("test_gem")) do
|
||||
builder = Bundler::Dsl.new
|
||||
builder.eval_gemfile(bundled_app("test_gem/Gemfile"))
|
||||
builder.dependencies
|
||||
rspec_dep = builder.dependencies.find {|d| d.name == "rspec" }
|
||||
expect(rspec_dep).to be_specific
|
||||
end
|
||||
end
|
||||
|
||||
it "requires 'test-gem'" do
|
||||
|
@ -411,8 +416,13 @@ RSpec.describe "bundle gem" do
|
|||
end
|
||||
|
||||
it "depends on a specific version of minitest" do
|
||||
minitest_dep = generated_gemspec.development_dependencies.find {|d| d.name == "minitest" }
|
||||
expect(minitest_dep).to be_specific
|
||||
Dir.chdir(bundled_app("test_gem")) do
|
||||
builder = Bundler::Dsl.new
|
||||
builder.eval_gemfile(bundled_app("test_gem/Gemfile"))
|
||||
builder.dependencies
|
||||
minitest_dep = builder.dependencies.find {|d| d.name == "minitest" }
|
||||
expect(minitest_dep).to be_specific
|
||||
end
|
||||
end
|
||||
|
||||
it "builds spec skeleton" do
|
||||
|
@ -703,7 +713,7 @@ RSpec.describe "bundle gem" do
|
|||
end
|
||||
|
||||
it "includes rake-compiler" do
|
||||
expect(bundled_app("test_gem/test_gem.gemspec").read).to include('spec.add_development_dependency "rake-compiler"')
|
||||
expect(bundled_app("test_gem/Gemfile").read).to include('gem "rake-compiler"')
|
||||
end
|
||||
|
||||
it "depends on compile task for build" do
|
||||
|
@ -808,7 +818,7 @@ Usage: "bundle gem NAME [OPTIONS]"
|
|||
RAKEFILE
|
||||
|
||||
expect(bundled_app("foobar/Rakefile").read).to eq(rakefile)
|
||||
expect(bundled_app("foobar/foobar.gemspec").read).to include('spec.add_development_dependency "rspec"')
|
||||
expect(bundled_app("foobar/Gemfile").read).to include('gem "rspec"')
|
||||
end
|
||||
|
||||
it "asks about MIT license" do
|
||||
|
|
Загрузка…
Ссылка в новой задаче