Running rspec Tests From vim in Another tmux Pane

When I write ruby code I usually write it in a tdd/bdd style using rspec as a test framework. I want to run tests directly from vim, but I do not like running tests through guard (don’t ask me why - I have no real answer).

I like the control of being able to run either all tests (leader-a) or current (or last run) test file (leader-t). I do not like that tests run in the window where my editor is, and that I have to press return to go back to my editor.

Luckily I use tmux as my terminal multiplexer and I have setup my vim to use the vimux plugin to run tests, if vim is running within tmux.

As you may be able to decipher from the animated gif, I am able to keep writing/editing code while the tests are running. But I am still able to see the feedback, and react to any errors as soon as they occur.

I do, however, want some better integration to vim. E.g. test failures to open in quickfix list. And I want to be able to use the same workflow using other test-frameworks and other programming languages.