Skip to content

Commit c83c31b

Browse files
authored
Merge pull request #667 from mernen/main
rails: fix check when no command is supplied
2 parents 9b8ba21 + 942f53e commit c83c31b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/spring/client/rails.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def call
2020

2121
if COMMANDS.include?(command_name)
2222
Run.call(["rails_#{command_name}", *args.drop(2)])
23-
elsif command_name.start_with?("db:")
23+
elsif command_name&.start_with?("db:")
2424
Run.call(["rake", *args.drop(1)])
2525
else
2626
require "spring/configuration"

test/support/acceptance_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,10 @@ def exec_name
693693
refute_output_includes "bin/rails runner ''", stderr: "WARN"
694694
end
695695

696+
test "rails without arguments" do
697+
assert_success "bin/rails"
698+
end
699+
696700
test "rails db:migrate" do
697701
assert_speedup do
698702
2.times { app.run "bin/rails db:migrate" }

0 commit comments

Comments
 (0)