Skip to content

Commit 942f53e

Browse files
committed
Fix check when no command is supplied
Closes #666.
1 parent c45b7ee commit 942f53e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/spring/client/rails.rb

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,10 @@ def exec_name
694694
refute_output_includes "bin/rails runner ''", stderr: "WARN"
695695
end
696696

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

0 commit comments

Comments
 (0)