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