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



3352
3353
3354
3355
3356
# File 'lib/hash_delegator.rb', line 3352

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



3372
3373
3374
3375
3376
3377
# File 'lib/hash_delegator.rb', line 3372

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



3380
3381
3382
3383
3384
# File 'lib/hash_delegator.rb', line 3380

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



3365
3366
3367
3368
3369
3370
# File 'lib/hash_delegator.rb', line 3365

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



3358
3359
3360
3361
3362
3363
# File 'lib/hash_delegator.rb', line 3358

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