Class: MarkdownExec::TestHashDelegator::TestHashDelegatorDisplayRequiredCode

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

Instance Method Summary collapse

Instance Method Details

#setupObject



2817
2818
2819
2820
2821
2822
# File 'lib/hash_delegator.rb', line 2817

def setup
  @hd = HashDelegator.new
  @hd.instance_variable_set(:@fout, mock('fout'))
  @hd.instance_variable_set(:@delegate_object, {})
  @hd.stubs(:string_send_color)
end

#test_display_required_codeObject



2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
# File 'lib/hash_delegator.rb', line 2824

def test_display_required_code
  required_lines = %w[line1 line2]
  @hd.instance_variable_get(:@delegate_object).stubs(:[]).with(:script_preview_head).returns('Header')
  @hd.instance_variable_get(:@delegate_object).stubs(:[]).with(:script_preview_tail).returns('Footer')
  @hd.instance_variable_get(:@fout).expects(:fout).times(4)

  @hd.display_required_code(required_lines: required_lines)

  # Verifying that fout is called for each line and for header & footer
  assert true # Placeholder for actual test assertions
end