diff options
-rw-r--r-- | lib/bundler/templates/newgem/Rakefile.tt | 2 | ||||
-rw-r--r-- | spec/bundler/commands/newgem_spec.rb | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/bundler/templates/newgem/Rakefile.tt b/lib/bundler/templates/newgem/Rakefile.tt index 46bb01c7f8..57222f8c56 100644 --- a/lib/bundler/templates/newgem/Rakefile.tt +++ b/lib/bundler/templates/newgem/Rakefile.tt @@ -36,4 +36,4 @@ Rake::ExtensionTask.new("<%= config[:underscored_name] %>") do |ext| end <% end -%> -task :default => <%= default_task_names.size == 1 ? default_task_names.first.inspect : default_task_names.inspect %> +task default: <%= default_task_names.size == 1 ? default_task_names.first.inspect : default_task_names.inspect %> diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb index 91e33bd2b9..f0f55ae2d5 100644 --- a/spec/bundler/commands/newgem_spec.rb +++ b/spec/bundler/commands/newgem_spec.rb @@ -155,9 +155,10 @@ RSpec.describe "bundle gem" do it "generates a gem skeleton with rubocop" do gem_skeleton_assertions expect(bundled_app("test-gem/Rakefile")).to read_as( - include('require "rubocop/rake_task"'). + include('# frozen_string_literal: true'). + and(include('require "rubocop/rake_task"'). and(include("RuboCop::RakeTask.new"). - and(match(/:default.+:rubocop/))) + and(match(/default:.+:rubocop/)))) ) end @@ -182,7 +183,6 @@ RSpec.describe "bundle gem" do realworld_system_gems gems, :path => path bundle "install", :dir => bundled_app("#{gem_name}") bundle "exec rubocop", :dir => bundled_app("#{gem_name}") - expect($?.exitstatus).to eq(0) if exitstatus end end @@ -555,7 +555,7 @@ RSpec.describe "bundle gem" do t.test_files = FileList["test/**/*_test.rb"] end - task :default => :test + task default: :test RAKEFILE expect(bundled_app("#{gem_name}/Rakefile").read).to eq(rakefile) @@ -613,7 +613,7 @@ RSpec.describe "bundle gem" do t.test_files = FileList["test/**/*_test.rb"] end - task :default => :test + task default: :test RAKEFILE expect(bundled_app("#{gem_name}/Rakefile").read).to eq(rakefile) @@ -914,7 +914,7 @@ RSpec.describe "bundle gem" do ext.lib_dir = "lib/#{gem_name}" end - task :default => [:clobber, :compile] + task default: [:clobber, :compile] RAKEFILE expect(bundled_app("#{gem_name}/Rakefile").read).to eq(rakefile) @@ -1010,7 +1010,7 @@ Usage: "bundle gem NAME [OPTIONS]" RSpec::Core::RakeTask.new(:spec) - task :default => :spec + task default: :spec RAKEFILE expect(bundled_app("foobar/Rakefile").read).to eq(rakefile) |