summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler/templates/newgem/bin/console.tt3
-rw-r--r--spec/bundler/commands/newgem_spec.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/templates/newgem/bin/console.tt b/lib/bundler/templates/newgem/bin/console.tt
index 6378a5abce..08dfaaef69 100644
--- a/lib/bundler/templates/newgem/bin/console.tt
+++ b/lib/bundler/templates/newgem/bin/console.tt
@@ -1,6 +1,5 @@
-# frozen_string_literal: true
-
#!/usr/bin/env ruby
+# frozen_string_literal: true
require "bundler/setup"
require "<%= config[:namespaced_path] %>"
diff --git a/spec/bundler/commands/newgem_spec.rb b/spec/bundler/commands/newgem_spec.rb
index 7dca5f5188..70419f612d 100644
--- a/spec/bundler/commands/newgem_spec.rb
+++ b/spec/bundler/commands/newgem_spec.rb
@@ -376,6 +376,8 @@ RSpec.describe "bundle gem" do
expect(bundled_app("#{gem_name}/bin/console")).to exist
expect(bundled_app("#{gem_name}/bin/setup")).to be_executable
expect(bundled_app("#{gem_name}/bin/console")).to be_executable
+ expect(bundled_app("#{gem_name}/bin/setup").read).to start_with("#!")
+ expect(bundled_app("#{gem_name}/bin/console").read).to start_with("#!")
end
it "starts with version 0.1.0" do