Class: MarkdownExec::TestHashDelegator::TestHashDelegatorFormatReferencesSendColor

Inherits:
Minitest::Test
  • Object
show all
Defined in:
lib/hash_delegator.rb

Instance Method Summary collapse

Instance Method Details

#setupObject



2925
2926
2927
2928
# File 'lib/hash_delegator.rb', line 2925

def setup
  @hd = HashDelegator.new
  @hd.instance_variable_set(:@delegate_object, {})
end

#test_format_references_send_color_with_missing_formatObject



2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
# File 'lib/hash_delegator.rb', line 2942

def test_format_references_send_color_with_missing_format
  @hd.instance_variable_get(:@delegate_object).stubs(:fetch).with(
    :output_execution_label_format, ''
  ).returns('')
  @hd.stubs(:string_send_color).returns('Default Colored String')

  result = @hd.format_references_send_color(context: { key: 'value' },
                                            color_sym: :execution_report_preview_frame_color)

  assert_equal 'Default Colored String', result
end

#test_format_references_send_color_with_valid_dataObject



2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
# File 'lib/hash_delegator.rb', line 2930

def test_format_references_send_color_with_valid_data
  @hd.instance_variable_get(:@delegate_object).stubs(:fetch).with(
    :output_execution_label_format, ''
  ).returns('Formatted: %{key}')
  @hd.stubs(:string_send_color).returns('Colored String')

  result = @hd.format_references_send_color(context: { key: 'value' },
                                            color_sym: :execution_report_preview_frame_color)

  assert_equal 'Colored String', result
end