1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
From: Daniel Leidert <dleidert@debian.org>
Date: Mon, 6 Jan 2020 17:17:36 +0100
Subject: Fix autopkgtest failure
https://lists.debian.org/debian-ruby/2020/01/msg00005.html
Forwarded: not-needed
---
test/test_configuration.rb | 4 +++-
test/test_new_command.rb | 6 ++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/test/test_configuration.rb b/test/test_configuration.rb
index 17c0d21..1d7a698 100644
--- a/test/test_configuration.rb
+++ b/test/test_configuration.rb
@@ -516,7 +516,9 @@ class TestConfiguration < JekyllUnitTest
should "ignore newlines in that string entirely from the template file" do
config = Jekyll.configuration(
@tester.read_config_file(
- File.expand_path("../lib/site_template/_config.yml", File.dirname(__FILE__))
+ File.file?(File.expand_path("../lib/site_template/_config.yml", File.dirname(__FILE__))) ?
+ File.expand_path("../lib/site_template/_config.yml", File.dirname(__FILE__)) :
+ File.expand_path("site_template/_config.yml", "/usr/lib/ruby/vendor_ruby") # fallback for autopkgtest
)
)
assert_includes config["description"], "an awesome description"
diff --git a/test/test_new_command.rb b/test/test_new_command.rb
index 632ad3d..859e906 100644
--- a/test/test_new_command.rb
+++ b/test/test_new_command.rb
@@ -11,7 +11,9 @@ class TestNewCommand < JekyllUnitTest
end
def site_template
- File.expand_path("../lib/site_template", __dir__)
+ Dir.exists?(File.expand_path("../lib/site_template", __dir__)) ?
+ File.expand_path("../lib/site_template", __dir__) :
+ File.expand_path("/usr/lib/ruby/vendor_ruby/site_template")
end
context "when args contains a path" do
@@ -57,7 +59,7 @@ class TestNewCommand < JekyllUnitTest
capture_output { Jekyll::Commands::New.process(@args) }
new_site_files = dir_contents(@full_path).reject do |f|
- File.extname(f) == ".markdown"
+ File.extname(f) == ".markdown" or File.extname(f) == ".lock"
end
assert_same_elements static_template_files, new_site_files
|