Class: MarkdownExec::TestHashDelegator::TestHashDelegatorFormatReferencesSendColor

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

Instance Method Summary collapse

Instance Method Details

#setupObject



2983
2984
2985
2986
# File 'lib/hash_delegator.rb', line 2983

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

#test_format_references_send_color_with_missing_formatObject



3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
# File 'lib/hash_delegator.rb', line 3000

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



2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
# File 'lib/hash_delegator.rb', line 2988

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