Class: MarkdownExec::TestHashDelegator::TestHashDelegatorFormatReferencesSendColor

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

Instance Method Summary collapse

Instance Method Details

#setupObject



2869
2870
2871
2872
# File 'lib/hash_delegator.rb', line 2869

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

#test_format_references_send_color_with_missing_formatObject



2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
# File 'lib/hash_delegator.rb', line 2886

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



2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
# File 'lib/hash_delegator.rb', line 2874

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