pezra / rspec-mode

An RSpec minor mode for Emacs
257 stars 112 forks source link

Low level configurable spec runner command #191

Closed nfedyashev closed 4 years ago

nfedyashev commented 4 years ago

Hi Dmitry!

I was wondering if rspec-mode in its current form(or with minor modifications) can work in my(slightly unconventional) development environment - I use my slightly underpowered laptop as my main coding emacs environment but a whole dev backend is a remote machine(web server, test runner etc). Source code is rsync-ed from the laptop to that remote machine.

That's the reason why I stopped using rspec-mode some time ago(which I really enjoyed).

What I'm trying to achieve is make rspec-mode call specs like

ssh nikita@tower.pc "tmux send-keys -t 1 C-c 'docker-compose run runner rspec spec/models/some_model_spec.rb:123' C-m"

So that's like some additional prefix(ssh nikita@tower.pc "tmux send-keys -t 1 C-c 'docker-compose run runner) + some suffix(' C-m")

Is it possible by setting rspec-docker-command to "ssh nikita@tower.pc "tmux send-keys -t 1 C-c 'docker-compose run runner"? Not sure about the ' C-m" suffix.

I don't expect to receive any feedback from the rspec runner in emacs console. If I can run it from emacs via ssh+tmux then it's good enough. If forking/patching the source code is the simplest way to do it, that's fine - any advice on where/how is greatly appreciated.

/cc @dgutov

Pic related: My other computer is a data center

dgutov commented 4 years ago

Adding an advice to rspec-compile-command can do it, I think.

Similarly to how rspec--vagrant-wrapper and rspec--docker-wrapper work.

dgutov commented 4 years ago

I don't expect to receive any feedback from the rspec runner in emacs console

That... might be a problem (not sure though). Since we're creating a compilation buffer with command's output.

nfedyashev commented 4 years ago

Thank you very much! I'll give it a try.