-
Notifications
You must be signed in to change notification settings - Fork 3
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
Example line numbers do not seem to match the source #18
Comments
Actually, I am not sure what's happening with the line numbers. require "./spec_helper"
Spectator.describe Bisect do
it "fails on an empty array" do
expect(false).to eq(true)
end
it "returns the only item" do
expect(false).to eq(true)
end
it "calls the block and returns the item that the block is truthy for" do
expect(false).to eq(true)
end
it "first verifies that all items are truthy" do
expect(false).to eq(true)
end
end prints
So the order is correct but the line numbers are somewhat random. Also, the it "one" do
false.should eq(true)
end can be invoked by calling any of
For spectator, only the exact line works. |
There seems to be some issue with macro expansion and the original AST position information. This should be fixed in the upcoming v0.10.0 code, I've verified the line numbers match up there. The fix can probably be back-ported to v0.9 of Spectator. As for multi-line matching, that will likely need additional work to make possible. |
This should be fixed in the latest release (0.9.31). Can you try it out and make sure it works on your end before we close this issue? |
I can confirm that running by line number picks the right As you said, anywhere else in the spec still does not work. |
Having a spec file
crystal spec
reportsThe example is defined at line 4 but (I suppose) after macro expansion it appears on line 21. This is a problem in case one uses tools like vim-test which run the spec-under-cursor using the line number of
it
.Can anything be done to make the line numbers match?
The text was updated successfully, but these errors were encountered: