class BlockLabelTest
def setup
def setup @block_data = { filename: 'example.md', headings: %w[Header1 Header2], menu_blocks_with_docname: true, menu_blocks_with_headings: false, title: 'Sample Title', body: 'Sample Body', text: 'Sample Text' } end
def test_make_method
def test_make_method assert_equal 'Sample Title example.md', BlockLabel.make(**@block_data) end
def test_make_method_with_headings
def test_make_method_with_headings @block_data[:menu_blocks_with_headings] = true label = BlockLabel.make(**@block_data) assert_equal 'Sample Title Header1 # Header2 example.md', label end
def test_make_method_without_title
def test_make_method_without_title @block_data[:title] = nil label = BlockLabel.make(**@block_data) assert_equal 'Sample Body example.md', label end
def test_make_method_without_title_and_body
def test_make_method_without_title_and_body @block_data[:title] = nil @block_data[:body] = nil label = BlockLabel.make(**@block_data) assert_equal 'Sample Text example.md', label end