Class: SavedFilesMatcherTest

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

Instance Method Summary collapse

Instance Method Details

#setupObject



42
43
44
45
# File 'lib/saved_files_matcher.rb', line 42

def setup
  @folder = 'fixtures'
  @glob = '*.md'
end

#test_list_allObject



47
48
49
50
# File 'lib/saved_files_matcher.rb', line 47

def test_list_all
  assert_kind_of Array,
                 MarkdownExec::SavedFilesMatcher.list_all(@folder, @glob)
end

#test_most_recentObject



52
53
54
55
# File 'lib/saved_files_matcher.rb', line 52

def test_most_recent
  assert_match(/\.md$/,
               MarkdownExec::SavedFilesMatcher.most_recent(@folder, @glob))
end

#test_most_recent_listObject



57
58
59
60
61
62
# File 'lib/saved_files_matcher.rb', line 57

def test_most_recent_list
  result = MarkdownExec::SavedFilesMatcher.most_recent_list(@folder, @glob,
                                                            5)
  assert_kind_of Array, result
  assert_operator result.size, :<=, 16
end