qrush / m

A Test::Unit runner that can run tests by line number.
MIT License
375 stars 59 forks source link

Multiline support: `m tests/test.rb:9:19` #61

Closed kirs closed 7 years ago

kirs commented 8 years ago

My use case for m is that I'd like to run multiple test lines at the same time: m tests/test.rb:9:19 to run both tests on lines 9 and 19.

I'm submitting the PR without test coverage just to collect the feedback on my feature. If contributors find it useful, I'll be happy to discuss the details of implementation and add test coverage.

review @zamith @qrush

zamith commented 8 years ago

Please tell me more about your use case. Why do you want to run different test from the same file at once? Do you have an example?

kirs commented 8 years ago

I have two use cases: 1) I just wrote 2 new tests in shop_test.rb and I'd like to run both of them. 2) I want to run tests that are affected by changed lines. To do so, I have a git wrapper that checks diff and calculates what lines in shop_test.rb have been changed and then runs them.

It's worth mentioning that RSpec supports rspec path/to/a_spec.rb:37:42.

zamith commented 8 years ago

Ok, I don't have any strong reason not to add this, so I'd say it's up to implementation now. If it is not a big hit performance wise on running m with just one line, I should be fine with it.

Do you want to give it a go?

zamith commented 8 years ago

@kirs Are you still interested in this?

westonganger commented 8 years ago

I like this idea you should totally add it.

westonganger commented 7 years ago

What is holding this up. The syntax here would never affect anyone who is not trying to do this, I see no reason not to merge this.