Rubymine & Guard: Driving me insane! Please help

Hi,

I am learning RoR with Michael Hardl's tutorial. I'm using guard to load spork, then trigger rspec tests when a file changes. This is a fantastic way to do things as it re-tests every time I change something that is tested. This means less disasters when I change things and forget, and I think it is good practice.

Rubymine does not seem to think the same way. At the moment I can only run tests manually.

Can someone please tell me how I can get Rubymine to use my Guardfile? Otherwise I will have to go back to using a text editor and no IDE.

I have read up on this, I saw Roman comment on an issue about this a year ago, but I cannot find a way to fix it it or get automated testing in Rubymine. I like the use of rspec, capybara, guard and spork and want to continue like this.

I spent all last night googling this and most of today as well and just can;t seem to find a working solution. Rubymine seems like a powerful editor but nothing ever seems easy to do or intuitive (sorry) but I am told it is the best out there so I am giving it a try.

Thanks very much for any help or direction you can give me :)

7 comments
Comment actions Permalink

erm...

I *think* I have the answer to my own question, but I hope someone can confirm for me please? There is an autotest icon at the left of the test window once you run it. I am not sure if this is working or not, but it does seem to test more than once, though what triggers the tests I am not sure of. I changed part of a layout and that didn't seem to trigger it, which is confusing.

0
Comment actions Permalink

Hi,

the autotest button is supposed to run tests every time you change/save something unless you have some files marked as red opened in RM.

Regards, Oleg.

0
Comment actions Permalink

What do you mean by "file marked as red" please? I haven't heard of that expression before.

0
Comment actions Permalink

RM marks a file with red line (in project view) if there are some (syntax) errors in the file.

Oleg.

0
Comment actions Permalink

Thanks Olev.

No I have no files like that.

It seems to be working now that I have it on autotest, though for some strange reason it runs a test even when I type something new but haven't hit CTRL+S to save the file, which seems odd behaviour.

Does it use the Guardfile to tell which files to check for changes or does it do it using the spec file please?

0
Comment actions Permalink

You do not have to press Ctrl-S in RM to save a file (there is auto-save option which is on).

RM now just check if any file has been changed to trigger tests start, neither Guardfile nor any other files are used to restrict the set of file
which can trigger the test execution.

Oleg.

0
Comment actions Permalink

That's good to know - thanks Olev :)

0

Please sign in to leave a comment.