Skip to content

Commit

Permalink
Merge pull request #667 from mernen/main
Browse files Browse the repository at this point in the history
rails: fix check when no command is supplied
  • Loading branch information
rafaelfranca authored Jan 20, 2022
2 parents 9b8ba21 + 942f53e commit c83c31b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/spring/client/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def call

if COMMANDS.include?(command_name)
Run.call(["rails_#{command_name}", *args.drop(2)])
elsif command_name.start_with?("db:")
elsif command_name&.start_with?("db:")
Run.call(["rake", *args.drop(1)])
else
require "spring/configuration"
Expand Down
4 changes: 4 additions & 0 deletions test/support/acceptance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ def exec_name
refute_output_includes "bin/rails runner ''", stderr: "WARN"
end

test "rails without arguments" do
assert_success "bin/rails"
end

test "rails db:migrate" do
assert_speedup do
2.times { app.run "bin/rails db:migrate" }
Expand Down

0 comments on commit c83c31b

Please sign in to comment.