Skip to content

Commit 6310d43

Browse files
author
Arthur Nogueira Neves
committed
Merge pull request #400 from arthurnn/master
Add rails test command
2 parents 69ddc03 + 0e5b528 commit 6310d43

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Not released
2+
3+
* Add `rails test` command.
4+
15
## 1.3.3
26

37
* Fix yet another problem with loading spring which seems to affect

lib/spring/client/rails.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
module Spring
44
module Client
55
class Rails < Command
6-
COMMANDS = Set.new %w(console runner generate destroy)
6+
COMMANDS = Set.new %w(console runner generate destroy test)
77

88
ALIASES = {
99
"c" => "console",
1010
"r" => "runner",
1111
"g" => "generate",
12-
"d" => "destroy"
12+
"d" => "destroy",
13+
"t" => "test"
1314
}
1415

1516
def self.description

lib/spring/commands/rails.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,16 @@ def extract_environment(args)
8383
end
8484
end
8585

86+
class RailsTest < Rails
87+
def command_name
88+
"test"
89+
end
90+
end
91+
8692
Spring.register_command "rails_console", RailsConsole.new
8793
Spring.register_command "rails_generate", RailsGenerate.new
8894
Spring.register_command "rails_destroy", RailsDestroy.new
8995
Spring.register_command "rails_runner", RailsRunner.new
96+
Spring.register_command "rails_test", RailsTest.new
9097
end
9198
end

0 commit comments

Comments
 (0)