-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding support for minitest #49
Conversation
1fb928f
to
085b027
Compare
|
||
isMiniTest: -> | ||
editor = atom.workspace.getActiveTextEditor() | ||
cursor = editor and editor.getCursor() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to changing API, this should now be: editor.getLastCursor()
.
This repeats much of what is on line 34. Can you reuse that logic?
5474d97
to
29f4a0e
Compare
thanks for the feedback, already removed the deprecated api |
This still incorrectly identifies an rspec project as a minitest project. Please clone https://github.com/moxley/atom-ruby-test-samples, and test your changes on the sample rspec project. Make sure it runs the rspec command, and not the minitest one. |
|
||
isMiniTest: -> | ||
i = @currentLine() - 1 | ||
regExp = new RegExp(/^(\s+)(should|test|it)\s+['""'](.*)['""']\s+do\s*(?:#.*)?$/) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Continuing on from the previous comment, this will match both a minitest spec test and an rspec test. That is bad. Instead, you could check the first line of the file, which usually contains require 'spec_helper'
for rspec.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a unit-test style minitest file contains a class that inherits from Minitest::Test
.
fixing bugs that causes rspec file to match minitest adding more tests adding initial tests adding support for minitest removing deprecated api removing console logs
@moxley it was my mistake. i had made the changes and tested on https://github.com/moxley/atom-ruby-test-samples and i also created a minitest_samples https://github.com/roychoo/minitest_sample and tested on that too. let me know if you want me to send a PR to the samples repo for minitest. |
@roychoo I've been thinking about your solution, and I think there is a more simple, flexible way to solve this problem. I've been using project-manager to create separate ruby-test settings for different projects. You can use it to configure your minitest proejcts. All you need to do is install the package, save your project as a project-manager project, edit the settings file, and add the ruby-test settings you want. If your project uses minitest and it has a |
But I think we still need the regex portion of it? As minitest spec we can run single test thru regex and rspec thru the line number? |
Yes, I see your point. That makes sense. I'm trying out your changes on a project that uses minitest. So far, it works well. I'll get back to you soon with some feedback. |
cool. let me know if you know of any other better way of handling this. |
Thanks @roychoo! |
Hi, this is for supporting minitest.
i found it helpful for me, thus creating a PR.
let me know if it is ok.