Update migration script (#1497)

* Add whitespace -> hyphens

* Update README
This commit is contained in:
Dawa Ometto
2020-03-25 12:29:39 +01:00
committed by GitHub
parent a45101cfe9
commit 0b1d7ab01c
4 changed files with 69 additions and 20 deletions
+21 -2
View File
@@ -23,6 +23,8 @@ waa
[[Subsub/Zaa.md]]
EOF
script_path = File.expand_path(File.join(File.dirname(__FILE__), '../', 'bin', 'gollum-migrate-tags'))
unless ENV['TRAVIS']
context '4.x -> 5.x tag migrator' do
@@ -36,13 +38,30 @@ unless ENV['TRAVIS']
PREFER_RELATIVE = true
RUN_SILENT = true
NO_DRY_RUN = true
script_path = File.expand_path(File.join(File.dirname(__FILE__), '../', 'bin', 'gollum-migrate-tags'))
HYPHENATE = false
Dir.chdir(@path) do
load script_path
end
f = File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
f = ::File.new(::File.join(@path, 'Subdir/Foo.md'), 'r')
assert_equal result, f.read
end
test 'change spaced filenames to hyphenated filenames' do
RUN_SILENT = true
NO_DRY_RUN = true
PREFER_RELATIVE = true
HYPHENATE = true
Dir.chdir(@path) do
load script_path
end
f = ::File.new(::File.join(@path, 'Home.textile'), 'r')
output = f.read
assert_equal true, output.include?('[[Bilbo-Baggins.md]]')
assert_equal true, output.include?('[[evil|Mordor/Eye-Of-Sauron.md]]')
end
teardown do
FileUtils.rm_rf(@path)