Class: MarkdownExec::TestHashDelegatorFormatReferencesSendColor

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

Instance Method Summary collapse

Instance Method Details

#setupObject



4699
4700
4701
4702
# File 'lib/hash_delegator.rb', line 4699

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

#test_format_references_send_color_with_missing_formatObject



4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
# File 'lib/hash_delegator.rb', line 4718

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



4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
# File 'lib/hash_delegator.rb', line 4704

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