未验证 提交 874dae1f 编写于 作者: Y Yuji Yaginuma 提交者: GitHub

Merge pull request #30004 from npenzin/patch-1

Update plugin_generator.rb
......@@ -167,7 +167,7 @@ def gemfile_entry
gemfile_in_app_path = File.join(rails_app_path, "Gemfile")
if File.exist? gemfile_in_app_path
entry = "gem '#{name}', path: '#{relative_path}'"
entry = "\ngem '#{name}', path: '#{relative_path}'"
append_file gemfile_in_app_path, entry
end
end
......
......@@ -515,10 +515,11 @@ def test_creating_plugin_in_app_directory_adds_gemfile_entry
gemfile_path = "#{Rails.root}/Gemfile"
Object.const_set("APP_PATH", Rails.root)
FileUtils.touch gemfile_path
File.write(gemfile_path, "#foo")
run_generator
assert_file gemfile_path, /gem 'bukkits', path: 'tmp\/bukkits'/
assert_file gemfile_path, /^gem 'bukkits', path: 'tmp\/bukkits'/
ensure
Object.send(:remove_const, "APP_PATH")
FileUtils.rm gemfile_path
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册