judofyr / minitest-line

MIT License
36 stars 5 forks source link

target file is always the file passed to ruby #11

Closed grosser closed 9 years ago

grosser commented 9 years ago

with a test that defines the first test using a helper we try to find tests in the wrong file.

describe "xxx" do
  some_helper_method

  it "xxx" do
  end
end

but since the invocation is always ruby xxx.rb -l 123 we can just grab $0 and use that as the file you are interested in -> much simpler and not more false matches

@judofyr

grosser commented 9 years ago

released in maxitest 1.2.0

judofyr commented 9 years ago

Well, I'm running tests through rake test, and then $0 is not the target file, no?

grosser commented 9 years ago

then you don't need/use -l right ?

On Mon, Feb 23, 2015 at 5:47 AM, Magnus Holm notifications@github.com wrote:

Well, I'm running tests through rake test, and then $0 is not the target file, no?

— Reply to this email directly or view it on GitHub https://github.com/judofyr/minitest-line/pull/11#issuecomment-75542958.

judofyr commented 9 years ago

I run rake test, and when a test fails I copy-paste the ruby … -l 123-line.

grosser commented 9 years ago

the output still has the correct file, that still works fine since it's coming from the failure methods source location

judofyr commented 9 years ago

Oh right. That makes sense. Sorry for the noise. Merging now.