Class: MinitestBender::Results::Expectation

Inherits:
Base
  • Object
show all
Defined in:
lib/minitest-bender/results/expectation.rb

Constant Summary

Constants inherited from Base

Base::NAME_PREFIX

Instance Attribute Summary collapse

Attributes inherited from Base

#execution_order, #state

Instance Method Summary collapse

Methods inherited from Base

#context, #file_path, #formatted_label, #formatted_label_and_time, #formatted_message, #formatted_name_with_context, #formatted_time, #name_sort_key, #rerun_line, #source_line_number, #source_location, #time_with_unit_and_padding_right, #to_icon

Constructor Details

#initialize(minitest_result, number, name) ⇒ Expectation

Returns a new instance of Expectation.



6
7
8
9
10
# File 'lib/minitest-bender/results/expectation.rb', line 6

def initialize(minitest_result, number, name)
  super(minitest_result)
  @number = number
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/minitest-bender/results/expectation.rb', line 4

def name
  @name
end

Instance Method Details

#formatted_number(_sorted_siblings = nil) ⇒ Object



12
13
14
# File 'lib/minitest-bender/results/expectation.rb', line 12

def formatted_number(_sorted_siblings = nil)
  " #{Colorizer.colorize(number, :number)} "
end

#number_sort_keyObject



16
17
18
# File 'lib/minitest-bender/results/expectation.rb', line 16

def number_sort_key
  @number_sort_key ||= number.to_i
end