From 8a80f8c38ad9774979b55c6d55d6b54cdf8011dc Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Sep 19 2018 11:19:13 +0000 Subject: update to version 3.8.4 --- diff --git a/.gitignore b/.gitignore index a55aab3..855cd32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ -jekyll-3.2.1.gem +/results* +/*.src.rpm + +/jekyll-3.2.1.gem /jekyll-3.8.2.gem /jekyll-3.8.2-test.tar.gz /jekyll-3.8.3.gem /jekyll-3.8.3-test.tar.gz +/jekyll-3.8.4.gem +/jekyll-3.8.4-test.tar.gz diff --git a/00-test-helper.patch b/00-test-helper.patch deleted file mode 100644 index bab805c..0000000 --- a/00-test-helper.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/test/helper.rb b/test/helper.rb -index aa94be13..9bef2a8e 100644 ---- a/test/helper.rb -+++ b/test/helper.rb -@@ -11,24 +11,10 @@ def jruby? - defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" - end - --if ENV["CI"] -- require "simplecov" -- SimpleCov.start --else -- require File.expand_path("simplecov_custom_profile", __dir__) -- SimpleCov.start "gem" do -- add_filter "/vendor/gem" -- add_filter "/vendor/bundle" -- add_filter ".bundle" -- end --end -- - require "nokogiri" - require "rubygems" - require "ostruct" - require "minitest/autorun" --require "minitest/reporters" --require "minitest/profile" - require "rspec/mocks" - require_relative "../lib/jekyll.rb" - -@@ -46,13 +32,6 @@ include Jekyll - - require "jekyll/commands/serve/servlet" - --# Report with color. --Minitest::Reporters.use! [ -- Minitest::Reporters::DefaultReporter.new( -- :color => true -- ), --] -- - module Minitest::Assertions - def assert_exist(filename, msg = nil) - msg = message(msg) { "Expected '#{filename}' to exist" } diff --git a/0000-test-helper-disable-simplecov-and-minitest-plugins.patch b/0000-test-helper-disable-simplecov-and-minitest-plugins.patch new file mode 100644 index 0000000..8adf6b4 --- /dev/null +++ b/0000-test-helper-disable-simplecov-and-minitest-plugins.patch @@ -0,0 +1,55 @@ +From 2fd3f9380a81a7ff4bc9687211ebf5aed17d2b62 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:16:08 +0200 +Subject: [PATCH 0/9] test/helper: disable simplecov and minitest plugins + +--- + test/helper.rb | 21 --------------------- + 1 file changed, 21 deletions(-) + +diff --git a/test/helper.rb b/test/helper.rb +index aa94be13..9bef2a8e 100644 +--- a/test/helper.rb ++++ b/test/helper.rb +@@ -11,24 +11,10 @@ def jruby? + defined?(RUBY_ENGINE) && RUBY_ENGINE == "jruby" + end + +-if ENV["CI"] +- require "simplecov" +- SimpleCov.start +-else +- require File.expand_path("simplecov_custom_profile", __dir__) +- SimpleCov.start "gem" do +- add_filter "/vendor/gem" +- add_filter "/vendor/bundle" +- add_filter ".bundle" +- end +-end +- + require "nokogiri" + require "rubygems" + require "ostruct" + require "minitest/autorun" +-require "minitest/reporters" +-require "minitest/profile" + require "rspec/mocks" + require_relative "../lib/jekyll.rb" + +@@ -46,13 +32,6 @@ include Jekyll + + require "jekyll/commands/serve/servlet" + +-# Report with color. +-Minitest::Reporters.use! [ +- Minitest::Reporters::DefaultReporter.new( +- :color => true +- ), +-] +- + module Minitest::Assertions + def assert_exist(filename, msg = nil) + msg = message(msg) { "Expected '#{filename}' to exist" } +-- +2.17.1 + diff --git a/0001-test-new_command-add-skip-bundle-to-fix-tests-withou.patch b/0001-test-new_command-add-skip-bundle-to-fix-tests-withou.patch new file mode 100644 index 0000000..bb662f0 --- /dev/null +++ b/0001-test-new_command-add-skip-bundle-to-fix-tests-withou.patch @@ -0,0 +1,92 @@ +From e127b87424b260e367afe55a971c40d8a2b28849 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:16:52 +0200 +Subject: [PATCH 1/9] test/new_command: add --skip-bundle to fix tests withouth + internet + +--- + test/test_new_command.rb | 24 ++++++++---------------- + 1 file changed, 8 insertions(+), 16 deletions(-) + +diff --git a/test/test_new_command.rb b/test/test_new_command.rb +index 632ad3d5..54bbf361 100644 +--- a/test/test_new_command.rb ++++ b/test/test_new_command.rb +@@ -27,34 +27,26 @@ class TestNewCommand < JekyllUnitTest + + should "create a new directory" do + refute_exist @full_path +- capture_output { Jekyll::Commands::New.process(@args) } ++ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } + assert_exist @full_path + end + + should "create a Gemfile" do + gemfile = File.join(@full_path, "Gemfile") + refute_exist @full_path +- capture_output { Jekyll::Commands::New.process(@args) } ++ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } + assert_exist gemfile + assert_match(%r!gem "jekyll", "~> #{Jekyll::VERSION}"!, File.read(gemfile)) + assert_match(%r!gem "github-pages"!, File.read(gemfile)) + end + +- should "display a success message" do +- output = capture_output { Jekyll::Commands::New.process(@args) } +- success_message = "New jekyll site installed in #{@full_path.cyan}. " +- bundle_message = "Running bundle install in #{@full_path.cyan}... " +- assert_includes output, success_message +- assert_includes output, bundle_message +- end +- + should "copy the static files in site template to the new directory" do + static_template_files = dir_contents(site_template).reject do |f| + File.extname(f) == ".erb" + end + static_template_files << "/Gemfile" + +- capture_output { Jekyll::Commands::New.process(@args) } ++ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } + + new_site_files = dir_contents(@full_path).reject do |f| + File.extname(f) == ".markdown" +@@ -76,7 +68,7 @@ class TestNewCommand < JekyllUnitTest + f.gsub! "0000-00-00", stubbed_date + end + +- capture_output { Jekyll::Commands::New.process(@args) } ++ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } + + new_site_files = dir_contents(@full_path).select do |f| + erb_template_files.include? f +@@ -87,15 +79,15 @@ class TestNewCommand < JekyllUnitTest + + should "create blank project" do + blank_contents = %w(/_drafts /_layouts /_posts /index.html) +- output = capture_output { Jekyll::Commands::New.process(@args, "--blank") } ++ output = capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle --blank") } + bundle_message = "Running bundle install in #{@full_path.cyan}..." + assert_same_elements blank_contents, dir_contents(@full_path) + refute_includes output, bundle_message + end + + should "force created folder" do +- capture_output { Jekyll::Commands::New.process(@args) } +- output = capture_output { Jekyll::Commands::New.process(@args, "--force") } ++ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle", ) } ++ output = capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle --force") } + assert_match %r!New jekyll site installed in!, output + end + +@@ -118,7 +110,7 @@ class TestNewCommand < JekyllUnitTest + + should "create a new directory" do + refute_exist @site_name_with_spaces +- capture_output { Jekyll::Commands::New.process(@multiple_args) } ++ capture_output { Jekyll::Commands::New.process(@multiple_args, "--skip-bundle") } + assert_exist @site_name_with_spaces + end + end +-- +2.17.1 + diff --git a/0002-test-rdiscount-adapt-to-different-TOC-generation-wit.patch b/0002-test-rdiscount-adapt-to-different-TOC-generation-wit.patch new file mode 100644 index 0000000..08768a2 --- /dev/null +++ b/0002-test-rdiscount-adapt-to-different-TOC-generation-wit.patch @@ -0,0 +1,38 @@ +From 7265a31796a2d0d44d175702f4eb4655486c5db0 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:17:48 +0200 +Subject: [PATCH 2/9] test/rdiscount: adapt to different TOC generation with + new versions + +--- + test/test_rdiscount.rb | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb +index 7116c29a..796ee81d 100644 +--- a/test/test_rdiscount.rb ++++ b/test/test_rdiscount.rb +@@ -28,16 +28,16 @@ class TestRdiscount < JekyllUnitTest + + should "render toc" do + toc = <<-TOC +- ++ +

Header 1

+ +- ++ +

Header 2

+ +

+-- +2.17.1 + diff --git a/0003-test-utils-remove-internet-connectivity-test.patch b/0003-test-utils-remove-internet-connectivity-test.patch new file mode 100644 index 0000000..67d7368 --- /dev/null +++ b/0003-test-utils-remove-internet-connectivity-test.patch @@ -0,0 +1,26 @@ +From 3a05800cb312187925017db4d843fc43bfafeb64 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:18:21 +0200 +Subject: [PATCH 3/9] test/utils: remove internet connectivity test + +--- + test/test_utils.rb | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/test/test_utils.rb b/test/test_utils.rb +index 844ef825..596bd8f9 100644 +--- a/test/test_utils.rb ++++ b/test/test_utils.rb +@@ -415,9 +415,4 @@ class TestUtils < JekyllUnitTest + end + end + +- context "Utils::Internet.connected?" do +- should "return true if there's internet" do +- assert Utils::Internet.connected? +- end +- end + end +-- +2.17.1 + diff --git a/0004-test-disable-tests-requiring-the-test-theme.patch b/0004-test-disable-tests-requiring-the-test-theme.patch new file mode 100644 index 0000000..2880d37 --- /dev/null +++ b/0004-test-disable-tests-requiring-the-test-theme.patch @@ -0,0 +1,279 @@ +From 2a931e1b73520e298cf0a2c6ed5f2b687097d9e8 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:22:01 +0200 +Subject: [PATCH 4/9] test: disable tests requiring the test theme + +--- + test/test_layout_reader.rb | 16 +++--- + test/test_site.rb | 29 ---------- + test/test_theme.rb | 91 -------------------------------- + test/test_theme_assets_reader.rb | 78 --------------------------- + 4 files changed, 8 insertions(+), 206 deletions(-) + delete mode 100644 test/test_theme.rb + delete mode 100644 test/test_theme_assets_reader.rb + +diff --git a/test/test_layout_reader.rb b/test/test_layout_reader.rb +index 6e56db8a..0f06da4d 100644 +--- a/test/test_layout_reader.rb ++++ b/test/test_layout_reader.rb +@@ -68,14 +68,14 @@ class TestLayoutReader < JekyllUnitTest + FileUtils.rm(theme_dir("_layouts", "theme-symlink.html")) + end + +- should "not read a symlink'd theme" do +- skip_if_windows "Jekyll does not currently support symlinks on Windows." +- +- layouts = LayoutReader.new(@site).read +- +- refute layouts.key?("theme-symlink"), \ +- "Should not read symlinked layout from theme" +- end ++# should "not read a symlink'd theme" do ++# skip_if_windows "Jekyll does not currently support symlinks on Windows." ++# ++# layouts = LayoutReader.new(@site).read ++# ++# refute layouts.key?("theme-symlink"), \ ++# "Should not read symlinked layout from theme" ++# end + end + end + end +diff --git a/test/test_site.rb b/test/test_site.rb +index 0af32fcb..7e2ef9e0 100644 +--- a/test/test_site.rb ++++ b/test/test_site.rb +@@ -67,18 +67,6 @@ class TestSite < JekyllUnitTest + site = Site.new(site_configuration({ "baseurl" => "/blog" })) + assert_equal "/blog", site.baseurl + end +- +- should "only include theme includes_path if the path exists" do +- site = fixture_site({ "theme" => "test-theme" }) +- assert_equal [source_dir("_includes"), theme_dir("_includes")], +- site.includes_load_paths +- +- allow(File).to receive(:directory?).with(theme_dir("_sass")).and_return(true) +- allow(File).to receive(:directory?).with(theme_dir("_layouts")).and_return(true) +- allow(File).to receive(:directory?).with(theme_dir("_includes")).and_return(false) +- site = fixture_site({ "theme" => "test-theme" }) +- assert_equal [source_dir("_includes")], site.includes_load_paths +- end + end + context "creating sites" do + setup do +@@ -247,14 +235,6 @@ class TestSite < JekyllUnitTest + assert_equal posts.size - @num_invalid_posts, @site.posts.size + end + +- should "skip posts with invalid encoding" do +- with_image_as_post do +- posts = read_posts +- num_invalid_posts = @num_invalid_posts + 1 +- assert_equal posts.size - num_invalid_posts, @site.posts.size +- end +- end +- + should "read pages with YAML front matter" do + abs_path = File.expand_path("about.html", @site.source) + assert_equal true, Utils.has_yaml_header?(abs_path) +@@ -584,15 +564,6 @@ class TestSite < JekyllUnitTest + "to use gem-based themes, but got Hash\n" + assert_includes output, expected_msg + end +- +- should "set a theme if the config is a string" do +- [:debug, :info, :warn, :error].each do |level| +- expect(Jekyll.logger.writer).not_to receive(level) +- end +- site = fixture_site({ "theme" => "test-theme" }) +- assert_instance_of Jekyll::Theme, site.theme +- assert_equal "test-theme", site.theme.name +- end + end + + context "with liquid profiling" do +diff --git a/test/test_theme.rb b/test/test_theme.rb +deleted file mode 100644 +index bc1f8de6..00000000 +--- a/test/test_theme.rb ++++ /dev/null +@@ -1,91 +0,0 @@ +-# frozen_string_literal: true +- +-require "helper" +- +-class TestTheme < JekyllUnitTest +- def setup +- @theme = Theme.new("test-theme") +- end +- +- context "initializing" do +- should "normalize the theme name" do +- theme = Theme.new(" Test-Theme ") +- assert_equal "test-theme", theme.name +- end +- +- should "know the theme root" do +- assert_equal theme_dir, @theme.root +- end +- +- should "know the theme version" do +- assert_equal Gem::Version.new("0.1.0"), @theme.version +- end +- +- should "raise an error for invalid themes" do +- assert_raises Jekyll::Errors::MissingDependencyException do +- Theme.new("foo").version +- end +- end +- +- should "add itself to sass's load path" do +- @theme.configure_sass +- message = "Sass load paths should include the theme sass dir" +- assert Sass.load_paths.include?(@theme.sass_path), message +- end +- end +- +- context "path generation" do +- [:assets, :_layouts, :_includes, :_sass].each do |folder| +- should "know the #{folder} path" do +- expected = theme_dir(folder.to_s) +- assert_equal expected, @theme.public_send("#{folder.to_s.tr("_", "")}_path") +- end +- end +- +- should "generate folder paths" do +- expected = theme_dir("_sass") +- assert_equal expected, @theme.send(:path_for, :_sass) +- end +- +- should "not allow paths outside of the theme root" do +- assert_nil @theme.send(:path_for, "../../source") +- end +- +- should "return nil for paths that don't exist" do +- assert_nil @theme.send(:path_for, "foo") +- end +- +- should "return the resolved path when a symlink & resolved path exists" do +- # no support for symlinks on Windows +- skip_if_windows "Jekyll does not currently support symlinks on Windows." +- +- expected = theme_dir("_layouts") +- assert_equal expected, @theme.send(:path_for, :_symlink) +- end +- end +- +- context "invalid theme" do +- context "initializing" do +- setup do +- stub_gemspec = Object.new +- +- # the directory for this theme should not exist +- allow(stub_gemspec).to receive(:full_gem_path) +- .and_return(File.expand_path("test/fixtures/test-non-existent-theme", __dir__)) +- +- allow(Gem::Specification).to receive(:find_by_name) +- .with("test-non-existent-theme") +- .and_return(stub_gemspec) +- end +- +- should "raise when getting theme root" do +- error = assert_raises(RuntimeError) { Theme.new("test-non-existent-theme") } +- assert_match(%r!fixtures\/test-non-existent-theme does not exist!, error.message) +- end +- end +- end +- +- should "retrieve the gemspec" do +- assert_equal "test-theme-0.1.0", @theme.send(:gemspec).full_name +- end +-end +diff --git a/test/test_theme_assets_reader.rb b/test/test_theme_assets_reader.rb +deleted file mode 100644 +index 358789f5..00000000 +--- a/test/test_theme_assets_reader.rb ++++ /dev/null +@@ -1,78 +0,0 @@ +-# frozen_string_literal: true +- +-require "helper" +- +-class TestThemeAssetsReader < JekyllUnitTest +- def setup +- @site = fixture_site( +- "theme" => "test-theme", +- "theme-color" => "black" +- ) +- assert @site.theme +- end +- +- def assert_file_with_relative_path(haystack, relative_path) +- assert haystack.any? { |f| +- f.relative_path == relative_path +- }, "Site should read in the #{relative_path} file, " \ +- "but it was not found in #{haystack.inspect}" +- end +- +- def refute_file_with_relative_path(haystack, relative_path) +- refute haystack.any? { |f| +- f.relative_path == relative_path +- }, "Site should not have read in the #{relative_path} file, " \ +- "but it was found in #{haystack.inspect}" +- end +- +- context "with a valid theme" do +- should "read all assets" do +- @site.reset +- ThemeAssetsReader.new(@site).read +- assert_file_with_relative_path @site.static_files, "/assets/img/logo.png" +- assert_file_with_relative_path @site.pages, "assets/style.scss" +- end +- +- should "convert pages" do +- @site.process +- +- file = @site.pages.find { |f| f.relative_path == "assets/style.scss" } +- refute_nil file +- assert_equal @site.in_dest_dir("assets/style.css"), file.destination(@site.dest) +- assert_includes file.output, ".sample {\n color: black; }" +- end +- +- should "not overwrite site content with the same relative path" do +- @site.reset +- @site.read +- +- file = @site.pages.find { |f| f.relative_path == "assets/application.coffee" } +- static_script = File.read( +- @site.static_files.find { |f| f.relative_path == "/assets/base.js" }.path +- ) +- refute_nil file +- refute_nil static_script +- assert_includes file.content, "alert \"From your site.\"" +- assert_includes static_script, "alert(\"From your site.\");" +- end +- end +- +- context "with a valid theme without an assets dir" do +- should "not read any assets" do +- site = fixture_site("theme" => "test-theme") +- allow(site.theme).to receive(:assets_path).and_return(nil) +- ThemeAssetsReader.new(site).read +- refute_file_with_relative_path site.static_files, "/assets/img/logo.png" +- refute_file_with_relative_path site.pages, "assets/style.scss" +- end +- end +- +- context "with no theme" do +- should "not read any assets" do +- site = fixture_site("theme" => nil) +- ThemeAssetsReader.new(site).read +- refute_file_with_relative_path site.static_files, "/assets/img/logo.png" +- refute_file_with_relative_path site.pages, "assets/style.scss" +- end +- end +-end +-- +2.17.1 + diff --git a/0005-tests-configuration-disable-tests-requiring-the-toml.patch b/0005-tests-configuration-disable-tests-requiring-the-toml.patch new file mode 100644 index 0000000..e799414 --- /dev/null +++ b/0005-tests-configuration-disable-tests-requiring-the-toml.patch @@ -0,0 +1,57 @@ +From cd3692af8dad4e3a06ec59ef712dce3ad04b5d1e Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:22:32 +0200 +Subject: [PATCH 5/9] tests/configuration: disable tests requiring the tomlrb + gem + +--- + test/test_configuration.rb | 33 --------------------------------- + 1 file changed, 33 deletions(-) + +diff --git a/test/test_configuration.rb b/test/test_configuration.rb +index 17c0d219..f4434639 100644 +--- a/test/test_configuration.rb ++++ b/test/test_configuration.rb +@@ -367,39 +367,6 @@ class TestConfiguration < JekyllUnitTest + Jekyll.configuration(test_config.merge({ "config" => [@paths[:empty]] })) + end + +- should "successfully load a TOML file" do +- Jekyll.logger.log_level = :warn +- assert_equal \ +- site_configuration({ +- "baseurl" => "/you-beautiful-blog-you", +- "title" => "My magnificent site, wut", +- "config" => [@paths[:toml]], +- }), +- Jekyll.configuration(test_config.merge({ "config" => [@paths[:toml]] })) +- Jekyll.logger.log_level = :info +- end +- +- should "load multiple config files" do +- External.require_with_graceful_fail("tomlrb") +- +- allow(SafeYAML).to receive(:load_file).with(@paths[:default]).and_return({}) +- allow(SafeYAML).to receive(:load_file).with(@paths[:other]).and_return({}) +- allow(Tomlrb).to receive(:load_file).with(@paths[:toml]).and_return({}) +- allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:default]}") +- allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:other]}") +- allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:toml]}") +- assert_equal( +- site_configuration({ +- "config" => [@paths[:default], @paths[:other], @paths[:toml]], +- }), +- Jekyll.configuration( +- test_config.merge( +- { "config" => [@paths[:default], @paths[:other], @paths[:toml]] } +- ) +- ) +- ) +- end +- + should "load multiple config files and last config should win" do + allow(SafeYAML) + .to receive(:load_file) +-- +2.17.1 + diff --git a/0006-tests-disable-tests-requiring-the-pygments.rb-gem.patch b/0006-tests-disable-tests-requiring-the-pygments.rb-gem.patch new file mode 100644 index 0000000..40b741c --- /dev/null +++ b/0006-tests-disable-tests-requiring-the-pygments.rb-gem.patch @@ -0,0 +1,375 @@ +From d2c49d84be1f4a427717578d57080ba4e67bc3ea Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:23:00 +0200 +Subject: [PATCH 6/9] tests: disable tests requiring the pygments.rb gem + +--- + test/test_redcarpet.rb | 17 --- + test/test_tags.rb | 317 ----------------------------------------- + 2 files changed, 334 deletions(-) + +diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb +index 51da49c5..48982ed8 100644 +--- a/test/test_redcarpet.rb ++++ b/test/test_redcarpet.rb +@@ -45,23 +45,6 @@ class TestRedcarpet < JekyllUnitTest + @markdown.convert("**bad code not here**: ").strip + end + +- context "with pygments enabled" do +- setup do +- @markdown = Converters::Markdown.new @config.merge( +- { "highlighter" => "pygments" } +- ) +- end +- +- should "render fenced code blocks with syntax highlighting" do +- assert_equal( +- %(
puts "Hello world"\n
), +- @markdown.convert(@sample).strip +- ) +- end +- end +- + context "with rouge enabled" do + setup do + @markdown = Converters::Markdown.new @config.merge({ "highlighter" => "rouge" }) +diff --git a/test/test_tags.rb b/test/test_tags.rb +index ae75c024..4bb7c209 100644 +--- a/test/test_tags.rb ++++ b/test/test_tags.rb +@@ -165,151 +165,6 @@ CONTENT + end + end + +- context "with the pygments highlighter" do +- setup do +- if jruby? +- then skip( +- "JRuby does not support Pygments." +- ) +- end +- end +- +- context "post content has highlight tag" do +- setup do +- fill_post("test", { "highlighter" => "pygments" }) +- end +- +- should "not cause a markdown error" do +- refute_match(%r!markdown\-html\-error!, @result) +- end +- +- should "render markdown with pygments" do +- assert_match( +- %(
) +
+-          %(test
), +- @result +- ) +- end +- +- should "render markdown with pygments with line numbers" do +- assert_match( +- %(
) +
+-          %(1 test
), +- @result +- ) +- end +- end +- +- context "post content has highlight with file reference" do +- setup do +- fill_post("./jekyll.gemspec", { "highlighter" => "pygments" }) +- end +- +- should "not embed the file" do +- assert_match( +- %(
) +
+-          %(./jekyll.gemspec
), +- @result +- ) +- end +- end +- +- context "post content has highlight tag with UTF character" do +- setup do +- fill_post("Æ", { "highlighter" => "pygments" }) +- end +- +- should "render markdown with pygments line handling" do +- assert_match( +- %(
) +
+-          %(Æ
), +- @result +- ) +- end +- end +- +- context "post content has highlight tag with preceding spaces & lines" do +- setup do +- code = <<-EOS +- +- +- [,1] [,2] +-[1,] FALSE TRUE +-[2,] FALSE TRUE +-EOS +- fill_post(code, { "highlighter" => "pygments" }) +- end +- +- should "only strip the preceding newlines" do +- assert_match( +- %(
) +
+-          %(     [,1] [,2]),
+-          @result
+-        )
+-      end
+-    end
+-
+-    context "post content has highlight tag " \
+-            "with preceding spaces & lines in several places" do
+-      setup do
+-        code = <<-EOS
+-
+-
+-     [,1] [,2]
+-
+-
+-[1,] FALSE TRUE
+-[2,] FALSE TRUE
+-
+-
+-EOS
+-        fill_post(code, { "highlighter" => "pygments" })
+-      end
+-
+-      should "only strip the newlines which precede and succeed the entire block" do
+-        assert_match(
+-          %(
) +
+-          %(     [,1] [,2]\n\n\n[1,] FALSE TRUE\n[2,] FALSE TRUE
), +- @result +- ) +- end +- end +- +- context "post content has highlight tag with " \ +- "preceding spaces & Windows-style newlines" do +- setup do +- fill_post "\r\n\r\n\r\n [,1] [,2]", { "highlighter" => "pygments" } +- end +- +- should "only strip the preceding newlines" do +- assert_match( +- %(
) +
+-          %(     [,1] [,2]),
+-          @result
+-        )
+-      end
+-    end
+-
+-    context "post content has highlight tag with only preceding spaces" do
+-      setup do
+-        code = <<-EOS
+-     [,1] [,2]
+-[1,] FALSE TRUE
+-[2,] FALSE TRUE
+-EOS
+-        fill_post(code, { "highlighter" => "pygments" })
+-      end
+-
+-      should "only strip the preceding newlines" do
+-        assert_match(
+-          %(
) +
+-          %(     [,1] [,2]),
+-          @result
+-        )
+-      end
+-    end
+-  end
+-
+   context "with the rouge highlighter" do
+     context "post content has highlight tag" do
+       setup do
+@@ -1165,177 +1020,5 @@ CONTENT
+         )
+       end
+     end
+-
+-    context "include tag with variable and liquid filters" do
+-      setup do
+-        site = fixture_site({ "pygments" => true }).tap(&:read).tap(&:render)
+-        post = site.posts.docs.find do |p|
+-          p.basename.eql? "2013-12-17-include-variable-filters.markdown"
+-        end
+-        @content = post.output
+-      end
+-
+-      should "include file as variable with liquid filters" do
+-        assert_match(%r!1 included!, @content)
+-        assert_match(%r!2 included!, @content)
+-        assert_match(%r!3 included!, @content)
+-      end
+-
+-      should "include file as variable and liquid filters with arbitrary whitespace" do
+-        assert_match(%r!4 included!, @content)
+-        assert_match(%r!5 included!, @content)
+-        assert_match(%r!6 included!, @content)
+-      end
+-
+-      should "include file as variable and filters with additional parameters" do
+-        assert_match("
  • var1 = foo
  • ", @content) +- assert_match("
  • var2 = bar
  • ", @content) +- end +- +- should "include file as partial variable" do +- assert_match(%r!8 included!, @content) +- end +- end +- end +- +- context "relative include tag with variable and liquid filters" do +- setup do +- site = fixture_site({ "pygments" => true }).tap(&:read).tap(&:render) +- post = site.posts.docs.find do |p| +- p.basename.eql? "2014-09-02-relative-includes.markdown" +- end +- @content = post.output +- end +- +- should "include file as variable with liquid filters" do +- assert_match(%r!1 relative_include!, @content) +- assert_match(%r!2 relative_include!, @content) +- assert_match(%r!3 relative_include!, @content) +- end +- +- should "include file as variable and liquid filters with arbitrary whitespace" do +- assert_match(%r!4 relative_include!, @content) +- assert_match(%r!5 relative_include!, @content) +- assert_match(%r!6 relative_include!, @content) +- end +- +- should "include file as variable and filters with additional parameters" do +- assert_match("
  • var1 = foo
  • ", @content) +- assert_match("
  • var2 = bar
  • ", @content) +- end +- +- should "include file as partial variable" do +- assert_match(%r!8 relative_include!, @content) +- end +- +- should "include files relative to self" do +- assert_match(%r!9 —\ntitle: Test Post Where YAML!, @content) +- end +- +- context "trying to do bad stuff" do +- context "include missing file" do +- setup do +- @content = < "pretty", +- "source" => source_dir, +- "destination" => dest_dir, +- "read_posts" => true, +- }) +- end +- assert_match "Could not locate the included file 'missing.html' in any of " \ +- "[\"#{source_dir}\"].", exception.message +- end +- end +- +- context "include existing file above you" do +- setup do +- @content = < "pretty", +- "source" => source_dir, +- "destination" => dest_dir, +- "read_posts" => true, +- }) +- end +- assert_equal( +- "Invalid syntax for include tag. File contains invalid characters or " \ +- "sequences:\n\n ../README.markdown\n\nValid syntax:\n\n " \ +- "{% include_relative file.ext param='value' param2='value' %}\n\n", +- exception.message +- ) +- end +- end +- end +- +- context "with symlink'd include" do +- should "not allow symlink includes" do +- File.open("tmp/pages-test", "w") { |file| file.write("SYMLINK TEST") } +- assert_raises IOError do +- content = < "pretty", +- "source" => source_dir, +- "destination" => dest_dir, +- "read_posts" => true, +- "safe" => true, +- }) +- end +- @result ||= "" +- refute_match(%r!SYMLINK TEST!, @result) +- end +- +- should "not expose the existence of symlinked files" do +- ex = assert_raises IOError do +- content = < "pretty", +- "source" => source_dir, +- "destination" => dest_dir, +- "read_posts" => true, +- "safe" => true, +- }) +- end +- assert_match( +- "Ensure it exists in one of those directories and is not a symlink "\ +- "as those are not allowed in safe mode.", +- ex.message +- ) +- end +- end + end + end +-- +2.17.1 + diff --git a/0007-tests-related_posts-disable-tests-requiring-the-clas.patch b/0007-tests-related_posts-disable-tests-requiring-the-clas.patch new file mode 100644 index 0000000..1a0d133 --- /dev/null +++ b/0007-tests-related_posts-disable-tests-requiring-the-clas.patch @@ -0,0 +1,86 @@ +From 2b85150666392127bfe010a14c6478905a97fa1e Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:23:20 +0200 +Subject: [PATCH 7/9] tests/related_posts: disable tests requiring the + classifier-reborn gem + +--- + test/test_related_posts.rb | 66 -------------------------------------- + 1 file changed, 66 deletions(-) + delete mode 100644 test/test_related_posts.rb + +diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb +deleted file mode 100644 +index d6a8fe6f..00000000 +--- a/test/test_related_posts.rb ++++ /dev/null +@@ -1,66 +0,0 @@ +-# frozen_string_literal: true +- +-require "helper" +- +-class TestRelatedPosts < JekyllUnitTest +- context "building related posts without lsi" do +- setup do +- @site = fixture_site +- end +- +- should "use the most recent posts for related posts" do +- @site.reset +- @site.read +- +- last_post = @site.posts.last +- related_posts = Jekyll::RelatedPosts.new(last_post).build +- +- last_ten_recent_posts = (@site.posts.docs.reverse - [last_post]).first(10) +- assert_equal last_ten_recent_posts, related_posts +- end +- end +- +- context "building related posts with LSI" do +- setup do +- if jruby? +- skip( +- "JRuby does not perform well with CExt, test disabled." +- ) +- end +- +- allow_any_instance_of(Jekyll::RelatedPosts).to receive(:display) +- @site = fixture_site({ +- "lsi" => true, +- }) +- +- @site.reset +- @site.read +- require "classifier-reborn" +- Jekyll::RelatedPosts.lsi = nil +- end +- +- should "index Jekyll::Post objects" do +- @site.posts.docs = @site.posts.docs.first(1) +- expect_any_instance_of(::ClassifierReborn::LSI).to \ +- receive(:add_item).with(kind_of(Jekyll::Document)) +- Jekyll::RelatedPosts.new(@site.posts.last).build_index +- end +- +- should "find related Jekyll::Post objects, given a Jekyll::Post object" do +- post = @site.posts.last +- allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index) +- expect_any_instance_of(::ClassifierReborn::LSI).to \ +- receive(:find_related).with(post, 11).and_return(@site.posts[-1..-9]) +- +- Jekyll::RelatedPosts.new(post).build +- end +- +- should "use LSI for the related posts" do +- allow_any_instance_of(::ClassifierReborn::LSI).to \ +- receive(:find_related).and_return(@site.posts[-1..-9]) +- allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index) +- +- assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build +- end +- end +-end +-- +2.17.1 + diff --git a/0008-test-coffeescript-disable-tests-requiring-the-coffee.patch b/0008-test-coffeescript-disable-tests-requiring-the-coffee.patch new file mode 100644 index 0000000..85f45cd --- /dev/null +++ b/0008-test-coffeescript-disable-tests-requiring-the-coffee.patch @@ -0,0 +1,69 @@ +From 2047b66adcf0d0aea84f490bd375c2a9f34554dc Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:23:48 +0200 +Subject: [PATCH 8/9] test/coffeescript: disable tests requiring the + coffeescript gem + +--- + test/test_coffeescript.rb | 49 --------------------------------------- + 1 file changed, 49 deletions(-) + delete mode 100644 test/test_coffeescript.rb + +diff --git a/test/test_coffeescript.rb b/test/test_coffeescript.rb +deleted file mode 100644 +index a60e0595..00000000 +--- a/test/test_coffeescript.rb ++++ /dev/null +@@ -1,49 +0,0 @@ +-# frozen_string_literal: true +- +-require "helper" +- +-class TestCoffeeScript < JekyllUnitTest +- context "converting CoffeeScript" do +- setup do +- External.require_with_graceful_fail("jekyll-coffeescript") +- @site = fixture_site +- @site.process +- @test_coffeescript_file = dest_dir("js/coffeescript.js") +- @js_output = <<-JS +-(function() { +- $(function() { +- var cube, cubes, list, num, square; +- list = [1, 2, 3, 4, 5]; +- square = function(x) { +- return x * x; +- }; +- cube = function(x) { +- return square(x) * x; +- }; +- cubes = (function() { +- var i, len, results; +- results = []; +- for (i = 0, len = list.length; i < len; i++) { +- num = list[i]; +- results.push(math.cube(num)); +- } +- return results; +- })(); +- if (typeof elvis !== "undefined" && elvis !== null) { +- return alert("I knew it!"); +- } +- }); +- +-}).call(this); +-JS +- end +- +- should "write a JS file in place" do +- assert_exist @test_coffeescript_file +- end +- +- should "produce JS" do +- assert_equal @js_output, File.read(@test_coffeescript_file) +- end +- end +-end +-- +2.17.1 + diff --git a/0009-test-plugin_manager-disable-tests-requiring-upstream.patch b/0009-test-plugin_manager-disable-tests-requiring-upstream.patch new file mode 100644 index 0000000..5609ca4 --- /dev/null +++ b/0009-test-plugin_manager-disable-tests-requiring-upstream.patch @@ -0,0 +1,53 @@ +From 9021c748e6ee4c3de028ac90c23f61ce8adeb16a Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 19 Sep 2018 12:24:23 +0200 +Subject: [PATCH 9/9] test/plugin_manager: disable tests requiring upstream + gemspec and Gemfile + +--- + test/test_plugin_manager.rb | 22 ---------------------- + 1 file changed, 22 deletions(-) + +diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb +index 213bcef6..326c887e 100644 +--- a/test/test_plugin_manager.rb ++++ b/test/test_plugin_manager.rb +@@ -10,16 +10,6 @@ class TestPluginManager < JekyllUnitTest + FileUtils.mv "Gemfile.old", "Gemfile" + end + +- context "JEKYLL_NO_BUNDLER_REQUIRE set to `nil`" do +- should "require from bundler" do +- with_env("JEKYLL_NO_BUNDLER_REQUIRE", nil) do +- assert Jekyll::PluginManager.require_from_bundler, +- "require_from_bundler should return true." +- assert ENV["JEKYLL_NO_BUNDLER_REQUIRE"], "Gemfile plugins were not required." +- end +- end +- end +- + context "JEKYLL_NO_BUNDLER_REQUIRE set to `true`" do + should "not require from bundler" do + with_env("JEKYLL_NO_BUNDLER_REQUIRE", "true") do +@@ -30,18 +20,6 @@ class TestPluginManager < JekyllUnitTest + end + end + +- context "JEKYLL_NO_BUNDLER_REQUIRE set to `nil` and no Gemfile present" do +- should "not require from bundler" do +- with_env("JEKYLL_NO_BUNDLER_REQUIRE", nil) do +- with_no_gemfile do +- refute Jekyll::PluginManager.require_from_bundler, +- "Gemfile plugins were required but shouldn't have been" +- assert_nil ENV["JEKYLL_NO_BUNDLER_REQUIRE"] +- end +- end +- end +- end +- + context "require gems" do + should "invoke `require_with_graceful_fail`" do + gems = %w(jemojii foobar) +-- +2.17.1 + diff --git a/01-test-new-command-skip-bundle.patch b/01-test-new-command-skip-bundle.patch deleted file mode 100644 index 77edfa6..0000000 --- a/01-test-new-command-skip-bundle.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/test/test_new_command.rb b/test/test_new_command.rb -index 632ad3d5..54bbf361 100644 ---- a/test/test_new_command.rb -+++ b/test/test_new_command.rb -@@ -27,34 +27,26 @@ class TestNewCommand < JekyllUnitTest - - should "create a new directory" do - refute_exist @full_path -- capture_output { Jekyll::Commands::New.process(@args) } -+ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } - assert_exist @full_path - end - - should "create a Gemfile" do - gemfile = File.join(@full_path, "Gemfile") - refute_exist @full_path -- capture_output { Jekyll::Commands::New.process(@args) } -+ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } - assert_exist gemfile - assert_match(%r!gem "jekyll", "~> #{Jekyll::VERSION}"!, File.read(gemfile)) - assert_match(%r!gem "github-pages"!, File.read(gemfile)) - end - -- should "display a success message" do -- output = capture_output { Jekyll::Commands::New.process(@args) } -- success_message = "New jekyll site installed in #{@full_path.cyan}. " -- bundle_message = "Running bundle install in #{@full_path.cyan}... " -- assert_includes output, success_message -- assert_includes output, bundle_message -- end -- - should "copy the static files in site template to the new directory" do - static_template_files = dir_contents(site_template).reject do |f| - File.extname(f) == ".erb" - end - static_template_files << "/Gemfile" - -- capture_output { Jekyll::Commands::New.process(@args) } -+ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } - - new_site_files = dir_contents(@full_path).reject do |f| - File.extname(f) == ".markdown" -@@ -76,7 +68,7 @@ class TestNewCommand < JekyllUnitTest - f.gsub! "0000-00-00", stubbed_date - end - -- capture_output { Jekyll::Commands::New.process(@args) } -+ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle") } - - new_site_files = dir_contents(@full_path).select do |f| - erb_template_files.include? f -@@ -87,15 +79,15 @@ class TestNewCommand < JekyllUnitTest - - should "create blank project" do - blank_contents = %w(/_drafts /_layouts /_posts /index.html) -- output = capture_output { Jekyll::Commands::New.process(@args, "--blank") } -+ output = capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle --blank") } - bundle_message = "Running bundle install in #{@full_path.cyan}..." - assert_same_elements blank_contents, dir_contents(@full_path) - refute_includes output, bundle_message - end - - should "force created folder" do -- capture_output { Jekyll::Commands::New.process(@args) } -- output = capture_output { Jekyll::Commands::New.process(@args, "--force") } -+ capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle", ) } -+ output = capture_output { Jekyll::Commands::New.process(@args, "--skip-bundle --force") } - assert_match %r!New jekyll site installed in!, output - end - -@@ -118,7 +110,7 @@ class TestNewCommand < JekyllUnitTest - - should "create a new directory" do - refute_exist @site_name_with_spaces -- capture_output { Jekyll::Commands::New.process(@multiple_args) } -+ capture_output { Jekyll::Commands::New.process(@multiple_args, "--skip-bundle") } - assert_exist @site_name_with_spaces - end - end diff --git a/02-test-rdiscount-behavior-fix.patch b/02-test-rdiscount-behavior-fix.patch deleted file mode 100644 index cc518fa..0000000 --- a/02-test-rdiscount-behavior-fix.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --git a/test/test_rdiscount.rb b/test/test_rdiscount.rb -index 7116c29a..796ee81d 100644 ---- a/test/test_rdiscount.rb -+++ b/test/test_rdiscount.rb -@@ -28,16 +28,16 @@ class TestRdiscount < JekyllUnitTest - - should "render toc" do - toc = <<-TOC -- -+ -

    Header 1

    - -- -+ -

    Header 2

    - -

    diff --git a/03-test-utils-disable-internet-check.patch b/03-test-utils-disable-internet-check.patch deleted file mode 100644 index 20a0e77..0000000 --- a/03-test-utils-disable-internet-check.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/test/test_utils.rb b/test/test_utils.rb -index 844ef825..596bd8f9 100644 ---- a/test/test_utils.rb -+++ b/test/test_utils.rb -@@ -415,9 +415,4 @@ class TestUtils < JekyllUnitTest - end - end - -- context "Utils::Internet.connected?" do -- should "return true if there's internet" do -- assert Utils::Internet.connected? -- end -- end - end diff --git a/04-test-disable-test-theme.patch b/04-test-disable-test-theme.patch deleted file mode 100644 index eb9e97c..0000000 --- a/04-test-disable-test-theme.patch +++ /dev/null @@ -1,235 +0,0 @@ -diff --git a/test/test_theme.rb b/test/test_theme.rb -deleted file mode 100644 -index bc1f8de6..00000000 ---- a/test/test_theme.rb -+++ /dev/null -@@ -1,91 +0,0 @@ --# frozen_string_literal: true -- --require "helper" -- --class TestTheme < JekyllUnitTest -- def setup -- @theme = Theme.new("test-theme") -- end -- -- context "initializing" do -- should "normalize the theme name" do -- theme = Theme.new(" Test-Theme ") -- assert_equal "test-theme", theme.name -- end -- -- should "know the theme root" do -- assert_equal theme_dir, @theme.root -- end -- -- should "know the theme version" do -- assert_equal Gem::Version.new("0.1.0"), @theme.version -- end -- -- should "raise an error for invalid themes" do -- assert_raises Jekyll::Errors::MissingDependencyException do -- Theme.new("foo").version -- end -- end -- -- should "add itself to sass's load path" do -- @theme.configure_sass -- message = "Sass load paths should include the theme sass dir" -- assert Sass.load_paths.include?(@theme.sass_path), message -- end -- end -- -- context "path generation" do -- [:assets, :_layouts, :_includes, :_sass].each do |folder| -- should "know the #{folder} path" do -- expected = theme_dir(folder.to_s) -- assert_equal expected, @theme.public_send("#{folder.to_s.tr("_", "")}_path") -- end -- end -- -- should "generate folder paths" do -- expected = theme_dir("_sass") -- assert_equal expected, @theme.send(:path_for, :_sass) -- end -- -- should "not allow paths outside of the theme root" do -- assert_nil @theme.send(:path_for, "../../source") -- end -- -- should "return nil for paths that don't exist" do -- assert_nil @theme.send(:path_for, "foo") -- end -- -- should "return the resolved path when a symlink & resolved path exists" do -- # no support for symlinks on Windows -- skip_if_windows "Jekyll does not currently support symlinks on Windows." -- -- expected = theme_dir("_layouts") -- assert_equal expected, @theme.send(:path_for, :_symlink) -- end -- end -- -- context "invalid theme" do -- context "initializing" do -- setup do -- stub_gemspec = Object.new -- -- # the directory for this theme should not exist -- allow(stub_gemspec).to receive(:full_gem_path) -- .and_return(File.expand_path("test/fixtures/test-non-existent-theme", __dir__)) -- -- allow(Gem::Specification).to receive(:find_by_name) -- .with("test-non-existent-theme") -- .and_return(stub_gemspec) -- end -- -- should "raise when getting theme root" do -- error = assert_raises(RuntimeError) { Theme.new("test-non-existent-theme") } -- assert_match(%r!fixtures\/test-non-existent-theme does not exist!, error.message) -- end -- end -- end -- -- should "retrieve the gemspec" do -- assert_equal "test-theme-0.1.0", @theme.send(:gemspec).full_name -- end --end -diff --git a/test/test_theme_assets_reader.rb b/test/test_theme_assets_reader.rb -deleted file mode 100644 -index 358789f5..00000000 ---- a/test/test_theme_assets_reader.rb -+++ /dev/null -@@ -1,78 +0,0 @@ --# frozen_string_literal: true -- --require "helper" -- --class TestThemeAssetsReader < JekyllUnitTest -- def setup -- @site = fixture_site( -- "theme" => "test-theme", -- "theme-color" => "black" -- ) -- assert @site.theme -- end -- -- def assert_file_with_relative_path(haystack, relative_path) -- assert haystack.any? { |f| -- f.relative_path == relative_path -- }, "Site should read in the #{relative_path} file, " \ -- "but it was not found in #{haystack.inspect}" -- end -- -- def refute_file_with_relative_path(haystack, relative_path) -- refute haystack.any? { |f| -- f.relative_path == relative_path -- }, "Site should not have read in the #{relative_path} file, " \ -- "but it was found in #{haystack.inspect}" -- end -- -- context "with a valid theme" do -- should "read all assets" do -- @site.reset -- ThemeAssetsReader.new(@site).read -- assert_file_with_relative_path @site.static_files, "/assets/img/logo.png" -- assert_file_with_relative_path @site.pages, "assets/style.scss" -- end -- -- should "convert pages" do -- @site.process -- -- file = @site.pages.find { |f| f.relative_path == "assets/style.scss" } -- refute_nil file -- assert_equal @site.in_dest_dir("assets/style.css"), file.destination(@site.dest) -- assert_includes file.output, ".sample {\n color: black; }" -- end -- -- should "not overwrite site content with the same relative path" do -- @site.reset -- @site.read -- -- file = @site.pages.find { |f| f.relative_path == "assets/application.coffee" } -- static_script = File.read( -- @site.static_files.find { |f| f.relative_path == "/assets/base.js" }.path -- ) -- refute_nil file -- refute_nil static_script -- assert_includes file.content, "alert \"From your site.\"" -- assert_includes static_script, "alert(\"From your site.\");" -- end -- end -- -- context "with a valid theme without an assets dir" do -- should "not read any assets" do -- site = fixture_site("theme" => "test-theme") -- allow(site.theme).to receive(:assets_path).and_return(nil) -- ThemeAssetsReader.new(site).read -- refute_file_with_relative_path site.static_files, "/assets/img/logo.png" -- refute_file_with_relative_path site.pages, "assets/style.scss" -- end -- end -- -- context "with no theme" do -- should "not read any assets" do -- site = fixture_site("theme" => nil) -- ThemeAssetsReader.new(site).read -- refute_file_with_relative_path site.static_files, "/assets/img/logo.png" -- refute_file_with_relative_path site.pages, "assets/style.scss" -- end -- end --end -diff --git a/test/test_site.rb b/test/test_site.rb -index 0af32fcb..7e2ef9e0 100644 ---- a/test/test_site.rb -+++ b/test/test_site.rb -@@ -67,18 +67,6 @@ class TestSite < JekyllUnitTest - site = Site.new(site_configuration({ "baseurl" => "/blog" })) - assert_equal "/blog", site.baseurl - end -- -- should "only include theme includes_path if the path exists" do -- site = fixture_site({ "theme" => "test-theme" }) -- assert_equal [source_dir("_includes"), theme_dir("_includes")], -- site.includes_load_paths -- -- allow(File).to receive(:directory?).with(theme_dir("_sass")).and_return(true) -- allow(File).to receive(:directory?).with(theme_dir("_layouts")).and_return(true) -- allow(File).to receive(:directory?).with(theme_dir("_includes")).and_return(false) -- site = fixture_site({ "theme" => "test-theme" }) -- assert_equal [source_dir("_includes")], site.includes_load_paths -- end - end - context "creating sites" do - setup do -@@ -247,14 +235,6 @@ class TestSite < JekyllUnitTest - assert_equal posts.size - @num_invalid_posts, @site.posts.size - end - -- should "skip posts with invalid encoding" do -- with_image_as_post do -- posts = read_posts -- num_invalid_posts = @num_invalid_posts + 1 -- assert_equal posts.size - num_invalid_posts, @site.posts.size -- end -- end -- - should "read pages with YAML front matter" do - abs_path = File.expand_path("about.html", @site.source) - assert_equal true, Utils.has_yaml_header?(abs_path) -@@ -584,15 +564,6 @@ class TestSite < JekyllUnitTest - "to use gem-based themes, but got Hash\n" - assert_includes output, expected_msg - end -- -- should "set a theme if the config is a string" do -- [:debug, :info, :warn, :error].each do |level| -- expect(Jekyll.logger.writer).not_to receive(level) -- end -- site = fixture_site({ "theme" => "test-theme" }) -- assert_instance_of Jekyll::Theme, site.theme -- assert_equal "test-theme", site.theme.name -- end - end - - context "with liquid profiling" do diff --git a/05-test-disable-toml.patch b/05-test-disable-toml.patch deleted file mode 100644 index 959a0e8..0000000 --- a/05-test-disable-toml.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff --git a/test/test_configuration.rb b/test/test_configuration.rb -index 17c0d219..f4434639 100644 ---- a/test/test_configuration.rb -+++ b/test/test_configuration.rb -@@ -367,39 +367,6 @@ class TestConfiguration < JekyllUnitTest - Jekyll.configuration(test_config.merge({ "config" => [@paths[:empty]] })) - end - -- should "successfully load a TOML file" do -- Jekyll.logger.log_level = :warn -- assert_equal \ -- site_configuration({ -- "baseurl" => "/you-beautiful-blog-you", -- "title" => "My magnificent site, wut", -- "config" => [@paths[:toml]], -- }), -- Jekyll.configuration(test_config.merge({ "config" => [@paths[:toml]] })) -- Jekyll.logger.log_level = :info -- end -- -- should "load multiple config files" do -- External.require_with_graceful_fail("tomlrb") -- -- allow(SafeYAML).to receive(:load_file).with(@paths[:default]).and_return({}) -- allow(SafeYAML).to receive(:load_file).with(@paths[:other]).and_return({}) -- allow(Tomlrb).to receive(:load_file).with(@paths[:toml]).and_return({}) -- allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:default]}") -- allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:other]}") -- allow($stdout).to receive(:puts).with("Configuration file: #{@paths[:toml]}") -- assert_equal( -- site_configuration({ -- "config" => [@paths[:default], @paths[:other], @paths[:toml]], -- }), -- Jekyll.configuration( -- test_config.merge( -- { "config" => [@paths[:default], @paths[:other], @paths[:toml]] } -- ) -- ) -- ) -- end -- - should "load multiple config files and last config should win" do - allow(SafeYAML) - .to receive(:load_file) diff --git a/06-test-disable-pygments.patch b/06-test-disable-pygments.patch deleted file mode 100644 index bbb5391..0000000 --- a/06-test-disable-pygments.patch +++ /dev/null @@ -1,362 +0,0 @@ -diff --git a/test/test_tags.rb b/test/test_tags.rb -index ae75c024..4bb7c209 100644 ---- a/test/test_tags.rb -+++ b/test/test_tags.rb -@@ -165,151 +165,6 @@ CONTENT - end - end - -- context "with the pygments highlighter" do -- setup do -- if jruby? -- then skip( -- "JRuby does not support Pygments." -- ) -- end -- end -- -- context "post content has highlight tag" do -- setup do -- fill_post("test", { "highlighter" => "pygments" }) -- end -- -- should "not cause a markdown error" do -- refute_match(%r!markdown\-html\-error!, @result) -- end -- -- should "render markdown with pygments" do -- assert_match( -- %(
    ) +
    --          %(test
    ), -- @result -- ) -- end -- -- should "render markdown with pygments with line numbers" do -- assert_match( -- %(
    ) +
    --          %(1 test
    ), -- @result -- ) -- end -- end -- -- context "post content has highlight with file reference" do -- setup do -- fill_post("./jekyll.gemspec", { "highlighter" => "pygments" }) -- end -- -- should "not embed the file" do -- assert_match( -- %(
    ) +
    --          %(./jekyll.gemspec
    ), -- @result -- ) -- end -- end -- -- context "post content has highlight tag with UTF character" do -- setup do -- fill_post("Æ", { "highlighter" => "pygments" }) -- end -- -- should "render markdown with pygments line handling" do -- assert_match( -- %(
    ) +
    --          %(Æ
    ), -- @result -- ) -- end -- end -- -- context "post content has highlight tag with preceding spaces & lines" do -- setup do -- code = <<-EOS -- -- -- [,1] [,2] --[1,] FALSE TRUE --[2,] FALSE TRUE --EOS -- fill_post(code, { "highlighter" => "pygments" }) -- end -- -- should "only strip the preceding newlines" do -- assert_match( -- %(
    ) +
    --          %(     [,1] [,2]),
    --          @result
    --        )
    --      end
    --    end
    --
    --    context "post content has highlight tag " \
    --            "with preceding spaces & lines in several places" do
    --      setup do
    --        code = <<-EOS
    --
    --
    --     [,1] [,2]
    --
    --
    --[1,] FALSE TRUE
    --[2,] FALSE TRUE
    --
    --
    --EOS
    --        fill_post(code, { "highlighter" => "pygments" })
    --      end
    --
    --      should "only strip the newlines which precede and succeed the entire block" do
    --        assert_match(
    --          %(
    ) +
    --          %(     [,1] [,2]\n\n\n[1,] FALSE TRUE\n[2,] FALSE TRUE
    ), -- @result -- ) -- end -- end -- -- context "post content has highlight tag with " \ -- "preceding spaces & Windows-style newlines" do -- setup do -- fill_post "\r\n\r\n\r\n [,1] [,2]", { "highlighter" => "pygments" } -- end -- -- should "only strip the preceding newlines" do -- assert_match( -- %(
    ) +
    --          %(     [,1] [,2]),
    --          @result
    --        )
    --      end
    --    end
    --
    --    context "post content has highlight tag with only preceding spaces" do
    --      setup do
    --        code = <<-EOS
    --     [,1] [,2]
    --[1,] FALSE TRUE
    --[2,] FALSE TRUE
    --EOS
    --        fill_post(code, { "highlighter" => "pygments" })
    --      end
    --
    --      should "only strip the preceding newlines" do
    --        assert_match(
    --          %(
    ) +
    --          %(     [,1] [,2]),
    --          @result
    --        )
    --      end
    --    end
    --  end
    --
    -   context "with the rouge highlighter" do
    -     context "post content has highlight tag" do
    -       setup do
    -@@ -1165,177 +1020,5 @@ CONTENT
    -         )
    -       end
    -     end
    --
    --    context "include tag with variable and liquid filters" do
    --      setup do
    --        site = fixture_site({ "pygments" => true }).tap(&:read).tap(&:render)
    --        post = site.posts.docs.find do |p|
    --          p.basename.eql? "2013-12-17-include-variable-filters.markdown"
    --        end
    --        @content = post.output
    --      end
    --
    --      should "include file as variable with liquid filters" do
    --        assert_match(%r!1 included!, @content)
    --        assert_match(%r!2 included!, @content)
    --        assert_match(%r!3 included!, @content)
    --      end
    --
    --      should "include file as variable and liquid filters with arbitrary whitespace" do
    --        assert_match(%r!4 included!, @content)
    --        assert_match(%r!5 included!, @content)
    --        assert_match(%r!6 included!, @content)
    --      end
    --
    --      should "include file as variable and filters with additional parameters" do
    --        assert_match("
  • var1 = foo
  • ", @content) -- assert_match("
  • var2 = bar
  • ", @content) -- end -- -- should "include file as partial variable" do -- assert_match(%r!8 included!, @content) -- end -- end -- end -- -- context "relative include tag with variable and liquid filters" do -- setup do -- site = fixture_site({ "pygments" => true }).tap(&:read).tap(&:render) -- post = site.posts.docs.find do |p| -- p.basename.eql? "2014-09-02-relative-includes.markdown" -- end -- @content = post.output -- end -- -- should "include file as variable with liquid filters" do -- assert_match(%r!1 relative_include!, @content) -- assert_match(%r!2 relative_include!, @content) -- assert_match(%r!3 relative_include!, @content) -- end -- -- should "include file as variable and liquid filters with arbitrary whitespace" do -- assert_match(%r!4 relative_include!, @content) -- assert_match(%r!5 relative_include!, @content) -- assert_match(%r!6 relative_include!, @content) -- end -- -- should "include file as variable and filters with additional parameters" do -- assert_match("
  • var1 = foo
  • ", @content) -- assert_match("
  • var2 = bar
  • ", @content) -- end -- -- should "include file as partial variable" do -- assert_match(%r!8 relative_include!, @content) -- end -- -- should "include files relative to self" do -- assert_match(%r!9 —\ntitle: Test Post Where YAML!, @content) -- end -- -- context "trying to do bad stuff" do -- context "include missing file" do -- setup do -- @content = < "pretty", -- "source" => source_dir, -- "destination" => dest_dir, -- "read_posts" => true, -- }) -- end -- assert_match "Could not locate the included file 'missing.html' in any of " \ -- "[\"#{source_dir}\"].", exception.message -- end -- end -- -- context "include existing file above you" do -- setup do -- @content = < "pretty", -- "source" => source_dir, -- "destination" => dest_dir, -- "read_posts" => true, -- }) -- end -- assert_equal( -- "Invalid syntax for include tag. File contains invalid characters or " \ -- "sequences:\n\n ../README.markdown\n\nValid syntax:\n\n " \ -- "{% include_relative file.ext param='value' param2='value' %}\n\n", -- exception.message -- ) -- end -- end -- end -- -- context "with symlink'd include" do -- should "not allow symlink includes" do -- File.open("tmp/pages-test", "w") { |file| file.write("SYMLINK TEST") } -- assert_raises IOError do -- content = < "pretty", -- "source" => source_dir, -- "destination" => dest_dir, -- "read_posts" => true, -- "safe" => true, -- }) -- end -- @result ||= "" -- refute_match(%r!SYMLINK TEST!, @result) -- end -- -- should "not expose the existence of symlinked files" do -- ex = assert_raises IOError do -- content = < "pretty", -- "source" => source_dir, -- "destination" => dest_dir, -- "read_posts" => true, -- "safe" => true, -- }) -- end -- assert_match( -- "Ensure it exists in one of those directories and is not a symlink "\ -- "as those are not allowed in safe mode.", -- ex.message -- ) -- end -- end - end - end -diff --git a/test/test_redcarpet.rb b/test/test_redcarpet.rb -index 51da49c5..48982ed8 100644 ---- a/test/test_redcarpet.rb -+++ b/test/test_redcarpet.rb -@@ -45,23 +45,6 @@ class TestRedcarpet < JekyllUnitTest - @markdown.convert("**bad code not here**: ").strip - end - -- context "with pygments enabled" do -- setup do -- @markdown = Converters::Markdown.new @config.merge( -- { "highlighter" => "pygments" } -- ) -- end -- -- should "render fenced code blocks with syntax highlighting" do -- assert_equal( -- %(
    puts "Hello world"\n
    ), -- @markdown.convert(@sample).strip -- ) -- end -- end -- - context "with rouge enabled" do - setup do - @markdown = Converters::Markdown.new @config.merge({ "highlighter" => "rouge" }) diff --git a/07-test-disable-classifier-reborn.patch b/07-test-disable-classifier-reborn.patch deleted file mode 100644 index fb3c217..0000000 --- a/07-test-disable-classifier-reborn.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/test/test_related_posts.rb b/test/test_related_posts.rb -deleted file mode 100644 -index d6a8fe6f..00000000 ---- a/test/test_related_posts.rb -+++ /dev/null -@@ -1,66 +0,0 @@ --# frozen_string_literal: true -- --require "helper" -- --class TestRelatedPosts < JekyllUnitTest -- context "building related posts without lsi" do -- setup do -- @site = fixture_site -- end -- -- should "use the most recent posts for related posts" do -- @site.reset -- @site.read -- -- last_post = @site.posts.last -- related_posts = Jekyll::RelatedPosts.new(last_post).build -- -- last_ten_recent_posts = (@site.posts.docs.reverse - [last_post]).first(10) -- assert_equal last_ten_recent_posts, related_posts -- end -- end -- -- context "building related posts with LSI" do -- setup do -- if jruby? -- skip( -- "JRuby does not perform well with CExt, test disabled." -- ) -- end -- -- allow_any_instance_of(Jekyll::RelatedPosts).to receive(:display) -- @site = fixture_site({ -- "lsi" => true, -- }) -- -- @site.reset -- @site.read -- require "classifier-reborn" -- Jekyll::RelatedPosts.lsi = nil -- end -- -- should "index Jekyll::Post objects" do -- @site.posts.docs = @site.posts.docs.first(1) -- expect_any_instance_of(::ClassifierReborn::LSI).to \ -- receive(:add_item).with(kind_of(Jekyll::Document)) -- Jekyll::RelatedPosts.new(@site.posts.last).build_index -- end -- -- should "find related Jekyll::Post objects, given a Jekyll::Post object" do -- post = @site.posts.last -- allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index) -- expect_any_instance_of(::ClassifierReborn::LSI).to \ -- receive(:find_related).with(post, 11).and_return(@site.posts[-1..-9]) -- -- Jekyll::RelatedPosts.new(post).build -- end -- -- should "use LSI for the related posts" do -- allow_any_instance_of(::ClassifierReborn::LSI).to \ -- receive(:find_related).and_return(@site.posts[-1..-9]) -- allow_any_instance_of(::ClassifierReborn::LSI).to receive(:build_index) -- -- assert_equal @site.posts[-1..-9], Jekyll::RelatedPosts.new(@site.posts.last).build -- end -- end --end diff --git a/08-test-disable-coffeescript.patch b/08-test-disable-coffeescript.patch deleted file mode 100644 index 716dc98..0000000 --- a/08-test-disable-coffeescript.patch +++ /dev/null @@ -1,55 +0,0 @@ -diff --git a/test/test_coffeescript.rb b/test/test_coffeescript.rb -deleted file mode 100644 -index a60e0595..00000000 ---- a/test/test_coffeescript.rb -+++ /dev/null -@@ -1,49 +0,0 @@ --# frozen_string_literal: true -- --require "helper" -- --class TestCoffeeScript < JekyllUnitTest -- context "converting CoffeeScript" do -- setup do -- External.require_with_graceful_fail("jekyll-coffeescript") -- @site = fixture_site -- @site.process -- @test_coffeescript_file = dest_dir("js/coffeescript.js") -- @js_output = <<-JS --(function() { -- $(function() { -- var cube, cubes, list, num, square; -- list = [1, 2, 3, 4, 5]; -- square = function(x) { -- return x * x; -- }; -- cube = function(x) { -- return square(x) * x; -- }; -- cubes = (function() { -- var i, len, results; -- results = []; -- for (i = 0, len = list.length; i < len; i++) { -- num = list[i]; -- results.push(math.cube(num)); -- } -- return results; -- })(); -- if (typeof elvis !== "undefined" && elvis !== null) { -- return alert("I knew it!"); -- } -- }); -- --}).call(this); --JS -- end -- -- should "write a JS file in place" do -- assert_exist @test_coffeescript_file -- end -- -- should "produce JS" do -- assert_equal @js_output, File.read(@test_coffeescript_file) -- end -- end --end diff --git a/09-test-disable-bundler.patch b/09-test-disable-bundler.patch deleted file mode 100644 index 8eb290d..0000000 --- a/09-test-disable-bundler.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/test/test_plugin_manager.rb b/test/test_plugin_manager.rb -index 213bcef6..326c887e 100644 ---- a/test/test_plugin_manager.rb -+++ b/test/test_plugin_manager.rb -@@ -10,16 +10,6 @@ class TestPluginManager < JekyllUnitTest - FileUtils.mv "Gemfile.old", "Gemfile" - end - -- context "JEKYLL_NO_BUNDLER_REQUIRE set to `nil`" do -- should "require from bundler" do -- with_env("JEKYLL_NO_BUNDLER_REQUIRE", nil) do -- assert Jekyll::PluginManager.require_from_bundler, -- "require_from_bundler should return true." -- assert ENV["JEKYLL_NO_BUNDLER_REQUIRE"], "Gemfile plugins were not required." -- end -- end -- end -- - context "JEKYLL_NO_BUNDLER_REQUIRE set to `true`" do - should "not require from bundler" do - with_env("JEKYLL_NO_BUNDLER_REQUIRE", "true") do -@@ -30,18 +20,6 @@ class TestPluginManager < JekyllUnitTest - end - end - -- context "JEKYLL_NO_BUNDLER_REQUIRE set to `nil` and no Gemfile present" do -- should "not require from bundler" do -- with_env("JEKYLL_NO_BUNDLER_REQUIRE", nil) do -- with_no_gemfile do -- refute Jekyll::PluginManager.require_from_bundler, -- "Gemfile plugins were required but shouldn't have been" -- assert_nil ENV["JEKYLL_NO_BUNDLER_REQUIRE"] -- end -- end -- end -- end -- - context "require gems" do - should "invoke `require_with_graceful_fail`" do - gems = %w(jemojii foobar) diff --git a/rubygem-jekyll.spec b/rubygem-jekyll.spec index 5664044..51dab53 100644 --- a/rubygem-jekyll.spec +++ b/rubygem-jekyll.spec @@ -2,8 +2,8 @@ Name: rubygem-%{gem_name} Summary: Simple, blog aware, static site generator -Version: 3.8.3 -Release: 2%{?dist} +Version: 3.8.4 +Release: 1%{?dist} License: MIT URL: https://github.com/jekyll/jekyll @@ -11,39 +11,42 @@ Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # Generated tarball of tests (not present in the gem file) # git clone https://github.com/jekyll/jekyll jekyll-repo && pushd jekyll-repo -# git checkout v3.8.3 -# git archive -o ../jekyll-3.8.3-test.tar.gz v3.8.3 test +# git checkout v3.8.4 +# git archive -o ../jekyll-3.8.4-test.tar.gz v3.8.4 test # popd # rm -rf jekyll-repo Source1: %{gem_name}-%{version}-test.tar.gz +# Patches generated with "git format-patch --start-number 0" +# Repository: https://pagure.io/jekyll-fedora/branch/fedora-3.8.4 +# Patches: v3.8.4 → fedora-3.8.4 # Patch test helper to disable code coverage and minitest plugins -Patch0: 00-test-helper.patch +Patch0: 0000-test-helper-disable-simplecov-and-minitest-plugins.patch # Patch tests for the "jekyll new" command to use "--skip-bundle" - to not # require internet access and fail due to timeouts in "bundle install" -Patch1: 01-test-new-command-skip-bundle.patch +Patch1: 0001-test-new_command-add-skip-bundle-to-fix-tests-withou.patch # Patch to adapt to different rdiscount TOC generation -Patch2: 02-test-rdiscount-behavior-fix.patch +Patch2: 0002-test-rdiscount-adapt-to-different-TOC-generation-wit.patch # Patch to remove (failing) internet connectivity check -Patch3: 03-test-utils-disable-internet-check.patch +Patch3: 0003-test-utils-remove-internet-connectivity-test.patch # Patch to disable broken tests using the "test-theme" theme -Patch4: 04-test-disable-test-theme.patch +Patch4: 0004-test-disable-tests-requiring-the-test-theme.patch # Patches to remove tests for optional functionality with missing dependencies: # classifier-reborn, jekyll-coffeescript, pygments.rb, tomlrb -Patch5: 05-test-disable-toml.patch -Patch6: 06-test-disable-pygments.patch -Patch7: 07-test-disable-classifier-reborn.patch -Patch8: 08-test-disable-coffeescript.patch +Patch5: 0005-tests-configuration-disable-tests-requiring-the-toml.patch +Patch6: 0006-tests-disable-tests-requiring-the-pygments.rb-gem.patch +Patch7: 0007-tests-related_posts-disable-tests-requiring-the-clas.patch +Patch8: 0008-test-coffeescript-disable-tests-requiring-the-coffee.patch # Patch to disable tests reliant on the Gemfile and .gemspec file, # which are not shipped as part of the jekyll gem: -Patch9: 09-test-disable-bundler.patch +Patch9: 0009-test-plugin_manager-disable-tests-requiring-upstream.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel @@ -180,6 +183,9 @@ ruby -I"lib:test" -e 'Dir.glob "./test/**/test_*.rb", &method(:require)' %changelog +* Wed Sep 19 2018 Fabio Valentini - 3.8.4-1 +- Update to version 3.8.4. + * Sat Jul 14 2018 Fedora Release Engineering - 3.8.3-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/sources b/sources index 9fd8b47..1473f95 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (jekyll-3.8.3.gem) = 3b1b486dcae67a92751f410c4984b25355abf6a04b445b8c6e17f102b9a8ee47a7ef143ea2f54afa3a537a92b7a28ec75383581eb018dd73bcd055aafec58ecf -SHA512 (jekyll-3.8.3-test.tar.gz) = ae06561ed1f5f5ebc7d1e9e6149edc97c31a09fe49d1e593573ec8a45dcec4e3e588c5daf9aae779c39adc9c6b85ea298257085557a08be03856d960a522a9f1 +SHA512 (jekyll-3.8.4.gem) = 139c235941951ad25888aa8b3fe3039d2de55d9e1056ad313828269f36fd8ae554c2f8e664411ade8f7a094d0135b8d7d382b92e66857251d8b20a806bce9d24 +SHA512 (jekyll-3.8.4-test.tar.gz) = f61b86d9690b0dfb2011548cb9e3d290de024bdb3fd38f122fa67e9f8ec94d5ae5fdbecaa0591a2e5c372a7027fc9d3fbeecf17685d5363eec6a2f138c8e0ca8