Skip to content

Commit

Permalink
ruby: add rspec key bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Luna authored and syl20bnr committed Dec 6, 2015
1 parent f1ee2c7 commit e9684f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
16 changes: 10 additions & 6 deletions layers/+lang/ruby/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,16 @@ directory local variables.
*** RSpec-mode
When =ruby-test-runner= equals =rspec=.

| Key binding | Description |
|-------------+----------------------|
| ~SPC m t a~ | run all specs |
| ~SPC m t l~ | run last failed spec |
| ~SPC m t r~ | re-run last spec |
| ~SPC m t t~ | run spec at pointer |
| Key binding | Description |
|-------------+------------------------------------|
| ~SPC m t a~ | run all specs |
| ~SPC m t c~ | =rspec-verify-continue= |
| ~SPC m t e~ | =rspec-toggle-example-pendingness= |
| ~SPC m t f~ | run method |
| ~SPC m t l~ | run last failed spec |
| ~SPC m t m~ | =rspec-verify-matching= |
| ~SPC m t r~ | re-run last spec |
| ~SPC m t t~ | run spec at pointer |

*** Ruby-test-mode
When =ruby-test-runner= equals =ruby-test=.
Expand Down
9 changes: 4 additions & 5 deletions layers/+lang/ruby/packages.el
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
ruby-tools
rvm
))

(if ruby-enable-enh-ruby-mode
(add-to-list 'ruby-packages 'enh-ruby-mode)
(add-to-list 'ruby-packages 'ruby-mode))
Expand Down Expand Up @@ -74,7 +73,6 @@
'(ruby-mode-hook enh-ruby-mode-hook)))))

(defun ruby/init-enh-ruby-mode ()
"Initialize Ruby Mode"
(use-package enh-ruby-mode
:mode (("\\(Rake\\|Thor\\|Guard\\|Gem\\|Cap\\|Vagrant\\|Berks\\|Pod\\|Puppet\\)file\\'" . enh-ruby-mode)
("\\.\\(rb\\|rabl\\|ru\\|builder\\|rake\\|thor\\|gemspec\\|jbuilder\\)\\'" . enh-ruby-mode))
Expand Down Expand Up @@ -121,7 +119,6 @@
'(ruby-mode-hook enh-ruby-mode-hook)))))

(defun ruby/init-robe ()
"Initialize Robe mode"
(use-package robe
:defer t
:init
Expand Down Expand Up @@ -153,7 +150,6 @@
"ss" 'ruby-switch-to-inf)))))

(defun ruby/init-rspec-mode ()
"Define keybindings for rspec mode"
(use-package rspec-mode
:defer t
:init
Expand All @@ -171,8 +167,11 @@
(dolist (mode '(ruby-mode enh-ruby-mode))
(spacemacs/set-leader-keys-for-major-mode mode
"ta" 'rspec-verify-all
"tc" 'rspec-verify-matching
"tc" 'rspec-verify-continue
"te" 'rspec-toggle-example-pendingness
"tf" 'rspec-verify-method
"tl" 'rspec-run-last-failed
"tm" 'rspec-verify-matching
"tr" 'rspec-rerun
"tt" 'rspec-verify-single)))))

Expand Down

0 comments on commit e9684f3

Please sign in to comment.