Class: MarkdownExec::TestHashDelegatorCollectRequiredCodeLines

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

Instance Method Summary collapse

Instance Method Details

#setupObject



4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
# File 'lib/hash_delegator.rb', line 4469

def setup
  @hd = HashDelegator.new
  @hd.instance_variable_set(:@delegate_object, {})
  @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



4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
# File 'lib/hash_delegator.rb', line 4482

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