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



3296
3297
3298
3299
3300
# File 'lib/hash_delegator.rb', line 3296

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



3316
3317
3318
3319
3320
3321
# File 'lib/hash_delegator.rb', line 3316

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_path_with_no_slash_substitutes_correctlyObject



3309
3310
3311
3312
3313
3314
# File 'lib/hash_delegator.rb', line 3309

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



3302
3303
3304
3305
3306
3307
# File 'lib/hash_delegator.rb', line 3302

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