Class: Minitest::Heat::Output::Issue

Inherits:
Object
  • Object
show all
Defined in:
lib/minitest/heat/output/issue.rb

Overview

Formats issues to output based on the issue type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(issue) ⇒ Issue

Returns a new instance of Issue.



10
11
12
13
# File 'lib/minitest/heat/output/issue.rb', line 10

def initialize(issue)
  @issue = issue
  @locations = issue.locations
end

Instance Attribute Details

#issueObject

rubocop:disable Metrics/ClassLength



8
9
10
# File 'lib/minitest/heat/output/issue.rb', line 8

def issue
  @issue
end

#locationsObject

rubocop:disable Metrics/ClassLength



8
9
10
# File 'lib/minitest/heat/output/issue.rb', line 8

def locations
  @locations
end

Instance Method Details

#tokensObject



15
16
17
18
19
20
21
22
# File 'lib/minitest/heat/output/issue.rb', line 15

def tokens
  case issue.type
  when :error, :broken  then exception_tokens
  when :failure         then failure_tokens
  when :skipped         then skipped_tokens
  when :painful, :slow  then slow_tokens
  end
end