This message was imported from the Ruby/Rails Modularity Slack server. Find more info in the import thread.
Message originally sent by slack user U717FXJ8HWK
Has anyone been able to figure out how to make RubyMine autodetect packs/foo/spec subfolders as containing specs? I know it’s possible to mark those as “Test Sources Root”, but it’s tedious if you have lots of packs.
Well this is funny, I have no idea if there’s a magic way to do it, but I wrote a Ruby script just yesterday to automatically mark all packs/*/spec as test roots in RubyMine Happy to share if you’re interested
Careful because there are a few things you need to change in there:
• the path to the project root (depending on where you put this script)
• the project name (ours is syft2backend)
• the root of your packs (in our project, we changed that to components)
Some thoughts:
• I think it would make sense to convert this script into a Rake task that would inspect Stimpack’s configuration to discover packages’ paths, so that there’s no possibility of paths being out of sync
• Rake task could be shipped as a gem (or as a part of some exising gem, TBD)
• Adding old backup cleanup would be nice
• It needs to become more generic (i.e. autodiscover .idea/*.iml instead of having it hardcoded)
I wholeheartedly agree with all of the above!
I hadn’t thought about sharing it with the world while writing it (I was busy fighting with Nokogiri just to make it work ), but I’d love to see this turned into something reusable in a plug-and-play way