Rename spec with class

When I refactor/rename a class or module, it would be nice if RubyMine offers to rename the RSpec spec for that module as well.

This is similar to, but different from the discussion in https://intellij-support.jetbrains.com/hc/en-us/community/posts/206725915-I-want-RubyMine-to-update-require-paths-after-I-move-a-file-

Is there currently a way to do this?

For example - class Foobar

Spec - foobar_spec.rb

Rename Foobar to Bar in the IDE, then the filesystem looks like:

foobar.rb -> bar.rb

foobar_spec -> bar_spec.rb

3 comments
Comment actions Permalink

Hello,

what RubyMine version do you use? It appears to be a known problem already fixed (https://youtrack.jetbrains.com/issue/RUBY-11508)

0
Comment actions Permalink

2016.2.1 I think 11508 is a different issue. 11508 seems to deal with renaming references to the class inside the RSpec file.

I'm talking about renaming the RSpec file itself. It's also possible that issue is only relevant to Rails. In this case, I'm talking about a non-Rails Ruby project.

0
Comment actions Permalink

Indeed, it doesn't work with a non RoR app. I've created a corresponding request on our tracker, please vote for it:
https://youtrack.jetbrains.com/issue/RUBY-18477

0

Please sign in to leave a comment.