Spring does not abide loss of its controlling terminal. Doing this for years, I’d never had a problem, until Spring came along. Sometimes, though, I’d just close that window, forgetting that there was something special about it: it was home to a backgrounded RubyMine process. After a few seconds, the IDE would appear… and I’d still have use of the terminal window for running other things. I’d always started RubyMine by cd’ing to the project directory in a terminal (“konsole” in KDE) and typing mine.
RUBY MINE TESTING TRIAL
Through trial and error, I eventually discovered that a Spring process would die if the terminal where I had started RubyMine went away - and it couldn’t start a new one without being connected to a terminal (leading to the getpgid error - apparently Spring was really close to its process group leader, in a Norman Bates kind of way). The only way I could get it to work again was to shut down RubyMine completely and start it up again. Spring was no longer running - and RubyMine was failing to start up an instance of it as it usually did automatically. Testing started at 2:16 PM `getpgid': No such process (Errno::ESRCH)
![ruby mine testing ruby mine testing](http://www.minsocam.org/msa/GemResearchSwisslab/GRS_CTG_05_p15-27.jpg)
Occasionally I run all tests from the command line, not RubyMine, so let’s add that to Spring as well:
RUBY MINE TESTING HOW TO
I hadn’t even generated a binstub yet - RubyMine knew how to invoke “spring rspec” on its own. That first run took five seconds or so, but when I pressed the button a second time it was instantaneous - indeed, it successfully ran the test in Spring. While doing this, my RubyMine instance was still open, and without changing anything I just hit the button to run the last test again ( the “Play” symbol).
![ruby mine testing ruby mine testing](https://cdn.aspentimes.com/wp-content/uploads/sites/5/2016/08/toxic-atd-081815-2.jpg)
RUBY MINE TESTING INSTALL
(As an aside, it would have been helpful if Spring printed suggestions to install plugins whenever presented with a missing command that matched a known plugin name! That would save newcomers a bit of time).Īdding gem 'spring-commands-rspec' and running Bundler again, Spring binstub now adds “rspec” to the list of commands in its usage statement. That plugin is the spring-commands-rspec gem, which is a great name that reads perfectly well as an English sentence. Spring doesn’t know about RSpec out of the box a plugin is required. Spring Commands RSpec’tĪs is the custom of my people, I consulted the google, and the README at provided an answer. To see if it was invoking bin/spring, I added a line to that file - puts "* this is bin/spring", and indeed, that prints, but spring doesn’t seem to know how to invoke rspec. Running from RubyMine again, still no joy - it prints a usage statement only. Then I ran a single spec from the terminal, to prove rspec worked: I ran rails g rspec:install to give me new configuration files. In the Gemfile I uncommented the gem "spork" line, and also told it to grab the latest RSpec, now 3.2.0.
RUBY MINE TESTING FULL
rspec and spec_helper.rb files - the spec_helper was full of Spork and RSpec 2.x configuration - nothing worth keeping.
![ruby mine testing ruby mine testing](https://resources.jetbrains.com/storage/products/rubymine/img/meta/preview.png)
Using the same tools as everyone else is good. Though some StackOverflow answers suggested fixes, many also suggested migrating to spring, a similar quick-start service that was now part of Rails by default. Until recently, I had used spork as a persistent test runner - spork would run continuously, and each time I pressed the key combination to run a test, it would be handed off to the long-running spork process in the background.īut this stopped working when I upgraded to RSpec 3. This includes RSpec, which is delightfully integrated with the editor. I love RubyMine - I’ve said so in a previous post - and I do almost all my work within the IDE.