Class: MarkdownExec::TestHashDelegatorCollectRequiredCodeLines

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

Instance Method Summary collapse

Instance Method Details

#setupObject



6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
# File 'lib/hash_delegator.rb', line 6416

def setup
  @hd = HashDelegator.new
  @mdoc = mock('YourMDocClass')
  @selected = FCB.new(
    body: ['key: value'],
    type: BlockType::VARS
  )
  HashDelegator.stubs(:read_required_blocks_from_temp_file).returns([])
  @hd.stubs(:string_send_color)
  @hd.stubs(:print)
end

#test_execute_block_type_port_code_lines_with_varsObject



6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
# File 'lib/hash_delegator.rb', line 6428

def test_execute_block_type_port_code_lines_with_vars
  YAML.stubs(:load).returns({ 'key' => 'value' })
  @mdoc.stubs(:collect_recursively_required_code)
       .returns({ code: ['code line'] })
  result = @hd.execute_block_type_port_code_lines(
    mdoc: @mdoc, selected: @selected, block_source: {}
  )

  assert_equal ['code line', 'key="value"'], result
end