I can’t take credit for this one; that goes to Ben Lindsey. But since the answer I needed was buried in a comment, I thought I’d give it a little more googleability.
RubyMine needs to load special test formatters for its built-in RSpec and Cucumber runners to work. You can easily configure it to talk to a Spork server when running tests, but you’ll get a LoadError (“no such file to load — teamcity/spec/runner/formatter/teamcity/formatter”) with a vanilla Spork setup because the server won’t be able to find the RubyMine formatter libraries.
The solution is to add the requisite paths in the Spork prefork block. Here’s mine:
Spork.prefork do
if ENV["RUBYMINE_HOME"]
$:.unshift(File.expand_path("rb/testing/patch/common", ENV["RUBYMINE_HOME"]))
$:.unshift(File.expand_path("rb/testing/patch/bdd", ENV["RUBYMINE_HOME"]))
end
# ...
end
I’ve put the above code in my spec_helper.rb as well as my Cucumber env.rb file. RUBYMINE_HOME is an environment variable I’ve set in my .zshenv file.





