How to save a file that has no changes?

I am using guard (https://github.com/guard/guard).  
I am working on a ruby file, let's call it banana.rb.  
I have a test file banana_test.rb.  
When I save banana.rb, I want guard to run banana_test.rb.

This always works in sublime or textmate.  In rubymine, this only works if I make a change to banana.rb.  I'm guessing rubymine is trying to be helpful/efficient, and is refusing to save banana.rb unless I've made a change to it.  

Any help is much appreciated.

12 comments
Comment actions Permalink

Oh, I'm using rubymine 6.3.3, if that matters.

0
Comment actions Permalink

Hi,

there is no such way, but it is unclear why you want to re-test unchanged file?

Regards, Oleg.

0
Comment actions Permalink

Thanks Oleg.

> there is no such way,

That's unfortunate.

> but it is unclear why you want to re-test unchanged file?

One example would be changing a string in a locale file (e.g. en.yml).  Guard doesn't realize that changing that string requires re-running certain tests.  This is something I could configure in my Guardfile, I suppose, though I doubt that's a common practice.

Thanks anyways,
-Jared

1
Comment actions Permalink

I think you have answered your question: guard should trigger a new run when en.yml is changed.
It is exactly what you need not a way to modify a file w/o actual modification.

Regards, Oleg.

0
Comment actions Permalink

It's not my preferred solution, but yes, it'll work, thanks.  

By the way, your response sounds a bit defensive, telling me what "I need".  I am a customer after all ..

0
Comment actions Permalink

I'm sorry if tone of my response was inapropriate :(  (English is not my native language)

Regards, Oleg.

0
Comment actions Permalink

I completely disagree, there are many reason you want to save an unmodified file and I've never used an editor before that tried to be smart about this.

Say you have a testfile that sometimes fails and you're trying to get to the bottom of it. I don't want to be adding/removing characters for each run.

Also I don't agree that the guard file should specify all dependencies, that would quickly run way too many tests on saving some files (It would probably have to run all integration tests on all model saves), which gets in the way of developing. I'll run a few integration tests that I know might fail and let my ci-server run the rest when I push my branch.

I expect my editor to save a file when I tell it to save a file, it's really as simple as that.

Henk.

p.s. sorry if this sounds aggressive, english is not my first language.

1
Comment actions Permalink

So, you are saying that when you want to debug/investigate failure of the particular test you still want to run tests using Guard, instead of running the problematic one?
Why so? I mean you sill either have to press shortcut for save or for run the test, but why you still prefer the former?

Regards, Oleg.

0
Comment actions Permalink

This is a big pain point for me as well. Our workflow depends heavily on build/test tools like guard and grunt, which rely on filesystem events to trigger actions. RubyMine takes away my ability to send those triggers at will.

I've come up with a crazy workaround that involves using a macro (bound to Cmd-S) to Save Document and then run `touch` as an external command. It is getting the job done, but RubyMine's world where almost everything is highly-configurable, I don't think I should have to go to such lengths.

1
Comment actions Permalink

+1 to make this work or can you help make the touch plugin work?

Here's my scenario

I'm working on a model or service modifying/adding functionality.

I have a variety of feature tests which depend on a large set of other components so it's infeasible to make a complicated Guardfile to cover all possibilities. Though Oleg, if you are volunteering...

So I need to be able to touch the file for the rspec and it's silly to keep adding blank lines or whatever.

I did notice the touch plugin for IDEA

https://plugins.jetbrains.com/plugin/4948?pr=

But it doesnt work in rubymine.  There are no errors, but no Touch operation shows up according to the docs.

Oleg, if we can't have this native in RubyMine, could you help make the plugin work?

 

1
Comment actions Permalink

I'd like to see any good solution on this. Right now I'm making an incidental change to the file I want to run in guard, saving the file and then reverting it to get the desired behaviour. This isn't really ideal.

 

If you stumble on this thread and would like to see a change, please comment and upvote the relevant comments.

0

Please sign in to leave a comment.