From e36f9d7da8a2bc0db2d84f530abeb2d089fa1b89 Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Tue, 4 Feb 2014 01:26:28 +0100 Subject: [PATCH 1/6] First draft --- test/source/_sass/_grid.scss | 1 + test/source/css/main.scss | 4 ++++ test/test_sass.rb | 10 ++++++++++ 3 files changed, 15 insertions(+) create mode 100644 test/source/_sass/_grid.scss create mode 100644 test/source/css/main.scss diff --git a/test/source/_sass/_grid.scss b/test/source/_sass/_grid.scss new file mode 100644 index 00000000..606aaf29 --- /dev/null +++ b/test/source/_sass/_grid.scss @@ -0,0 +1 @@ +.half { width: 50%; } \ No newline at end of file diff --git a/test/source/css/main.scss b/test/source/css/main.scss new file mode 100644 index 00000000..abc9ecd8 --- /dev/null +++ b/test/source/css/main.scss @@ -0,0 +1,4 @@ +--- +--- + +@import "grid"; \ No newline at end of file diff --git a/test/test_sass.rb b/test/test_sass.rb index d13fbcfe..1dc04874 100644 --- a/test/test_sass.rb +++ b/test/test_sass.rb @@ -104,4 +104,14 @@ CSS assert_equal css_output, converter.convert(scss_content) end end + + context "importing partials" do + setup do + content = "" + end + + should "import SCSS" do + assert_equal ".half { width: 30%; }", content + end + end end From 8e0a826cc7edb00588df7987b32aa620bd6201cc Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Tue, 4 Feb 2014 01:31:37 +0100 Subject: [PATCH 2/6] Fix group_by_filter test by adding 2 items --- test/test_filters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_filters.rb b/test/test_filters.rb index 4b5c8212..015b4bf0 100644 --- a/test/test_filters.rb +++ b/test/test_filters.rb @@ -131,7 +131,7 @@ class TestFilters < Test::Unit::TestCase assert_equal 2, g["items"].size when "" assert g["items"].is_a?(Array), "The list of grouped items for '' is not an Array." - assert_equal 6, g["items"].size + assert_equal 8, g["items"].size end end end From 9e4dea14e4b44d22e97d6be88978de690d899d5a Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Tue, 4 Feb 2014 02:03:14 +0100 Subject: [PATCH 3/6] Fix partial test --- test/test_sass.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/test/test_sass.rb b/test/test_sass.rb index 1dc04874..0daa4f1d 100644 --- a/test/test_sass.rb +++ b/test/test_sass.rb @@ -107,11 +107,16 @@ CSS context "importing partials" do setup do - content = "" + @site = Jekyll::Site.new(Jekyll.configuration({ + "source" => source_dir, + "destination" => dest_dir + })) + @site.process + @test_css_file = dest_dir("css/main.css") end - should "import SCSS" do - assert_equal ".half { width: 30%; }", content + should "import SCSS partial" do + assert_equal ".half {\n width: 50%; }\n", File.read(@test_css_file) end end end From ce2b4ae9635d3fff081ad03fdd6ab6ed18273752 Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Tue, 4 Feb 2014 02:06:50 +0100 Subject: [PATCH 4/6] Upgrade gemspec --- jekyll.gemspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jekyll.gemspec b/jekyll.gemspec index 85b697e9..c5648c77 100644 --- a/jekyll.gemspec +++ b/jekyll.gemspec @@ -272,11 +272,13 @@ Gem::Specification.new do |s| test/source/_posts/2013-12-17-include-variable-filters.markdown test/source/_posts/2013-12-20-properties.text test/source/_posts/es/2008-11-21-nested.textile + test/source/_sass/_grid.scss test/source/about.html test/source/category/_posts/2008-9-23-categories.textile test/source/contacts.html test/source/contacts/bar.html test/source/contacts/index.html + test/source/css/main.scss test/source/css/screen.css test/source/deal.with.dots.html test/source/foo/_posts/bar/2008-12-12-topical-post.textile From 487e7a71372446d69cdb3f09936490e05ba88b5a Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Tue, 4 Feb 2014 09:23:00 +0100 Subject: [PATCH 5/6] Make sort test run --- test/test_site.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_site.rb b/test/test_site.rb index 5e639f50..3b29a78c 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -157,7 +157,7 @@ class TestSite < Test::Unit::TestCase should "sort pages alphabetically" do stub.proxy(Dir).entries { |entries| entries.reverse } @site.process - sorted_pages = %w(.htaccess about.html bar.html coffeescript.coffee contacts.html deal.with.dots.html foo.md index.html index.html properties.html sitemap.xml symlinked-file) + sorted_pages = %w(.htaccess about.html bar.html coffeescript.coffee contacts.html deal.with.dots.html foo.md index.html index.html main.scss main.scss properties.html sitemap.xml symlinked-file) assert_equal sorted_pages, @site.pages.map(&:name) end From c17ed7ec93073dfeb8f272448df43d737d113d06 Mon Sep 17 00:00:00 2001 From: Anatol Broder Date: Sat, 8 Feb 2014 13:26:03 +0100 Subject: [PATCH 6/6] Add comment about symlinked directories --- test/test_site.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/test_site.rb b/test/test_site.rb index 3b29a78c..31752967 100644 --- a/test/test_site.rb +++ b/test/test_site.rb @@ -157,6 +157,7 @@ class TestSite < Test::Unit::TestCase should "sort pages alphabetically" do stub.proxy(Dir).entries { |entries| entries.reverse } @site.process + # files in symlinked directories may appear twice sorted_pages = %w(.htaccess about.html bar.html coffeescript.coffee contacts.html deal.with.dots.html foo.md index.html index.html main.scss main.scss properties.html sitemap.xml symlinked-file) assert_equal sorted_pages, @site.pages.map(&:name) end