Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/ruby_lsp/ruby_lsp_rspec/rspec_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def generate_id(example)
def adjust_backtrace(backtrace)
# Correct the backtrace entry so that vscode recognized it as a link to open
parts = backtrace.split(":", 3)
parts[0].sub(/^\./, "file://" + File.expand_path(".")) + ":" + parts[1] + " : " + parts[2]
parts[0].sub(/^\./, "file://" + File.expand_path(".")) + ":" + parts[1] + " : " + (parts[2] || "")
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions spec/fixtures/rspec_example_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,9 @@
it "raises an error" do
raise "oops"
end
it "is pending but fixed" do
pending
expect { raise "error" }.to raise_error
end
end
end
16 changes: 16 additions & 0 deletions spec/rspec_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,22 @@
"uri" => "file://#{fixture_path}",
},
},
{
"method" => "start",
"params" => {
"id" => "./spec/fixtures/rspec_example_spec.rb:11::./spec/fixtures/rspec_example_spec.rb:12::./spec/fixtures/rspec_example_spec.rb:33",
"line" => "33",
"uri" => "file://#{fixture_path}",
},
},
{
"method" => "fail",
"params" => {
"id" => "./spec/fixtures/rspec_example_spec.rb:11::./spec/fixtures/rspec_example_spec.rb:12::./spec/fixtures/rspec_example_spec.rb:33",
"message" => "Expected pending 'No reason given' to fail. No error was raised.\n\n# file://#{fixture_path}:33 : ",
"uri" => "file://#{fixture_path}",
},
},
{ "method" => "finish", "params" => {} },
]

Expand Down