Class: MarkdownExec::TestCollectUniqueNames

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

Instance Method Summary collapse

Instance Method Details

#setupObject



406
407
408
# File 'lib/mdoc.rb', line 406

def setup
  @mdoc = MDoc.new
end

#test_empty_hashObject



410
411
412
# File 'lib/mdoc.rb', line 410

def test_empty_hash
  assert_empty @mdoc.collect_unique_names({})
end

#test_multiple_keysObject



419
420
421
422
# File 'lib/mdoc.rb', line 419

def test_multiple_keys
  input = { group1: %w[Alice Bob], group2: %w[Charlie Alice] }
  assert_equal %w[Alice Bob Charlie], @mdoc.collect_unique_names(input)
end

#test_no_unique_namesObject



424
425
426
427
# File 'lib/mdoc.rb', line 424

def test_no_unique_names
  input = { group1: ['Alice'], group2: ['Alice'] }
  assert_equal ['Alice'], @mdoc.collect_unique_names(input)
end

#test_single_keyObject



414
415
416
417
# File 'lib/mdoc.rb', line 414

def test_single_key
  input = { group1: %w[Alice Bob Charlie] }
  assert_equal %w[Alice Bob Charlie], @mdoc.collect_unique_names(input)
end