Class: MarkdownExec::TestCollectUniqueNames

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

Instance Method Summary collapse

Instance Method Details

#setupObject



567
568
569
# File 'lib/mdoc.rb', line 567

def setup
  @mdoc = MDoc.new
end

#test_empty_hashObject



571
572
573
# File 'lib/mdoc.rb', line 571

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

#test_multiple_keysObject



580
581
582
583
# File 'lib/mdoc.rb', line 580

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



585
586
587
588
# File 'lib/mdoc.rb', line 585

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

#test_single_keyObject



575
576
577
578
# File 'lib/mdoc.rb', line 575

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