Class: MarkdownExec::PathUtilsTest

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

Instance Method Summary collapse

Instance Method Details

#test_absolute_path_returns_unchangedObject



7113
7114
7115
7116
7117
7118
7119
# File 'lib/hash_delegator.rb', line 7113

def test_absolute_path_returns_unchanged
  absolute_path = '/usr/local/bin'
  expression = 'path/to/*/directory'
  assert_equal absolute_path,
               PathUtils.resolve_path_or_substitute(absolute_path,
                                                    expression)
end

#test_empty_path_substitutionObject



7139
7140
7141
7142
7143
7144
7145
# File 'lib/hash_delegator.rb', line 7139

def test_empty_path_substitution
  empty_path = ''
  expression = 'path/to/*/directory'
  expected_output = 'path/to//directory'
  assert_equal expected_output,
               PathUtils.resolve_path_or_substitute(empty_path, expression)
end

#test_format_utf8_charactersObject

Test formatting a string containing UTF-8 characters



7148
7149
7150
7151
7152
# File 'lib/hash_delegator.rb', line 7148

def test_format_utf8_characters
  input = 'Unicode test: ā, ö, 💻, and 🚀 are fun!'
  expected = '# Unicode test: ā, ö, 💻, and 🚀 are fun!'
  assert_equal expected, BashCommentFormatter.format_comment(input)
end

#test_path_with_no_slash_substitutes_correctlyObject



7130
7131
7132
7133
7134
7135
7136
7137
# File 'lib/hash_delegator.rb', line 7130

def test_path_with_no_slash_substitutes_correctly
  relative_path = 'data'
  expression = 'path/to/*/directory'
  expected_output = 'path/to/data/directory'
  assert_equal expected_output,
               PathUtils.resolve_path_or_substitute(relative_path,
                                                    expression)
end

#test_relative_path_gets_substitutedObject



7121
7122
7123
7124
7125
7126
7127
7128
# File 'lib/hash_delegator.rb', line 7121

def test_relative_path_gets_substituted
  relative_path = 'my_folder'
  expression = 'path/to/*/directory'
  expected_output = 'path/to/my_folder/directory'
  assert_equal expected_output,
               PathUtils.resolve_path_or_substitute(relative_path,
                                                    expression)
end