Class: MarkdownExec::TestHashDelegatorDisplayRequiredCode

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

Instance Method Summary collapse

Instance Method Details

#setupObject



4643
4644
4645
4646
4647
4648
# File 'lib/hash_delegator.rb', line 4643

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



4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
# File 'lib/hash_delegator.rb', line 4650

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