Skip to content

Commit 9540e78

Browse files
Fix JRuby backtrace filter spec. (#54)
1 parent e1e3efd commit 9540e78

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

test/sus/output/backtrace.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
let(:identity) {Sus::Identity.current}
1010
let(:backtrace) {subject.new(caller_locations)}
1111

12+
# The root path of stack paths. This is similar to __dir__ but not exactly the same, as JRuby computes `__dir__` as an absolute path even when it doesn't make sense.
13+
let(:backtrace_path_root) {File.dirname(__FILE__)}
14+
1215
it "has several frames" do
1316
expect(backtrace.stack).to have_attributes(size: be >= 1)
1417
end
@@ -53,7 +56,7 @@
5356
Sus::Output::Backtrace::Location.new("/tmp/four.rb", 4, "four"),
5457
]
5558

56-
backtrace = subject.new(stack, __dir__)
59+
backtrace = subject.new(stack, backtrace_path_root)
5760

5861
expect(backtrace.filter.map(&:label)).to be == ["one", "two", "three"]
5962
end

0 commit comments

Comments
 (0)