Class: MarkdownExec::TestMDocCollectDependencies

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

Instance Method Summary collapse

Instance Method Details

#setupObject



382
383
384
# File 'lib/mdoc.rb', line 382

def setup
  @mdoc = MDoc.new
end

#test_collect_dependencies_with_no_sourceObject



386
387
388
# File 'lib/mdoc.rb', line 386

def test_collect_dependencies_with_no_source
  assert_empty @mdoc.collect_dependencies(nil)
end

#test_collect_dependencies_with_valid_sourceObject



396
397
398
399
400
401
402
# File 'lib/mdoc.rb', line 396

def test_collect_dependencies_with_valid_source
  @mdoc.stubs(:get_block_by_anyname).with('source1').returns({ reqs: ['source2'] })
  @mdoc.stubs(:get_block_by_anyname).with('source2').returns({ reqs: [] })

  expected = { 'source1' => ['source2'], 'source2' => [] }
  assert_equal expected, @mdoc.collect_dependencies('source1')
end