lib/petitest/texts/raised_code_text.rb in petitest-0.2.1 vs lib/petitest/texts/raised_code_text.rb in petitest-0.3.0
- old
+ new
@@ -1,16 +1,16 @@
require "petitest/texts/base_text"
module Petitest
module Texts
class RaisedCodeText < ::Petitest::Texts::BaseText
- # @return [Petitest::TestCase]
- attr_reader :test_case
+ # @return [Petitest::Test]
+ attr_reader :test
- # @param test_case [Petitest::TestCase]
- def initialize(test_case:)
- @test_case = test_case
+ # @param test [Petitest::Test]
+ def initialize(test:)
+ @test = test
end
# @note Override
def to_s
if content = caller_file_content
@@ -42,11 +42,11 @@
end
# @return [Array<String>]
def caller_segments
@caller_segments ||= begin
- if test_case.filtered_backtrace[0]
- test_case.filtered_backtrace[0].split(":", 3)
+ if test.runner.filtered_backtrace[0]
+ test.runner.filtered_backtrace[0].split(":", 3)
else
[]
end
end
end