Class: MarkdownExec::TestHashDelegator::TestHashDelegatorFormatReferencesSendColor

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

Instance Method Summary collapse

Instance Method Details

#setupObject



2771
2772
2773
2774
# File 'lib/hash_delegator.rb', line 2771

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

#test_format_references_send_color_with_missing_formatObject



2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
# File 'lib/hash_delegator.rb', line 2788

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



2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
# File 'lib/hash_delegator.rb', line 2776

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