Class: MarkdownExec::TestMDocCollectDependencies
- Defined in:
- lib/mdoc.rb
Instance Method Summary collapse
- #setup ⇒ Object
- #test_collect_dependencies_with_no_source ⇒ Object
-
#test_collect_dependencies_with_nonexistent_source ⇒ Object
must raise error.
- #test_collect_dependencies_with_valid_source ⇒ Object
Instance Method Details
#test_collect_dependencies_with_no_source ⇒ Object
458 459 460 |
# File 'lib/mdoc.rb', line 458 def test_collect_dependencies_with_no_source assert_empty @mdoc.collect_dependencies(nil) end |
#test_collect_dependencies_with_nonexistent_source ⇒ Object
must raise error
463 464 465 466 467 |
# File 'lib/mdoc.rb', line 463 def test_collect_dependencies_with_nonexistent_source assert_raises(RuntimeError) do @mdoc.collect_dependencies('nonexistent') end end |
#test_collect_dependencies_with_valid_source ⇒ Object
469 470 471 472 473 474 475 |
# File 'lib/mdoc.rb', line 469 def test_collect_dependencies_with_valid_source @mdoc.stubs(:get_block_by_anyname).with('source1').returns(OpenStruct.new(reqs: ['source2'])) @mdoc.stubs(:get_block_by_anyname).with('source2').returns(OpenStruct.new(reqs: [])) expected = { 'source1' => ['source2'], 'source2' => [] } assert_equal expected, @mdoc.collect_dependencies('source1') end |