Skip to content

Commit

Permalink
Added tests for collections
Browse files Browse the repository at this point in the history
  • Loading branch information
imathis committed Jan 5, 2015
1 parent 6b55df1 commit 55c92a4
Show file tree
Hide file tree
Showing 28 changed files with 144 additions and 301 deletions.
46 changes: 46 additions & 0 deletions .clash.yml
@@ -0,0 +1,46 @@
-
title: Standard build
build: true
compare: _expected/compressed _site
-
title: Uncompressed build
build: true
compare: _expected/uncompressed _site
config:
jekyll:
- _config.yml
- _minify-false.yml
-
title: ENV production build
build: true
compare: _expected/compressed _site
config:
jekyll:
- _config.yml
- _env-prod.yml
-
title: ENV development build
build: true
compare: _expected/uncompressed _site
config:
jekyll:
- _config.yml
- _env-dev.yml
-
title: ENV production override build
build: true
compare: _expected/uncompressed _site
config:
jekyll:
- _config.yml
- _env-prod.yml
- _minify-false.yml
-
title: ENV development override build
build: true
compare: _expected/compressed _site
config:
jekyll:
- _config.yml
- _env-dev.yml
- _minify-true.yml
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -15,3 +15,4 @@ spec/reports
test/tmp
test/version_tmp
tmp
_site
7 changes: 4 additions & 3 deletions .travis.yml
@@ -1,4 +1,5 @@
language: ruby
rvm: 1.9.3
script: cd test && ruby test.rb

rvm:
- 2.0.0
- 1.9.3
script: bundle exec clash test
10 changes: 7 additions & 3 deletions CHANGELOG.md
@@ -1,15 +1,19 @@
# Changelog

## 1.1.0 (2013-11-02)
### 1.2.0 (2015-01-05)

- Added support for Jekyll collections.

### 1.1.0 (2013-11-02)

- [CHANGE] Now minifies HTML by default. Disable by setting config `env` to something other than `production` or by setting config `minify_html: false`.

## 1.0.1 (2013-10-25)
### 1.0.1 (2013-10-25)

- Now compatible with Jekyll 0.12+
- Added tests for Jekyll 0.12 and Jekyll 1.0

## 1.0.0 (2013-10-24)
### 1.0.0 (2013-10-24)

Initial Release

3 changes: 2 additions & 1 deletion jekyll-minify-html.gemspec
Expand Up @@ -13,13 +13,14 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/imathis/jekyll-minify-html"
spec.license = "MIT"

spec.files = `git ls-files`.split($/)
spec.files = `git ls-files`.split("\n").grep(%r{^(bin\/|lib\/|assets\/|changelog|readme|license)}i)
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "clash"

spec.add_runtime_dependency "jekyll", ">= 0.12"
spec.add_runtime_dependency "html_press", "~> 0.8.2"
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-minify-html/version.rb
@@ -1,5 +1,5 @@
module Jekyll
module MinifyHTMLVersion
VERSION = "1.1.0"
VERSION = "1.2.0"
end
end
1 change: 0 additions & 1 deletion test/.gitignore

This file was deleted.

22 changes: 22 additions & 0 deletions test/_collection_test/test.md
@@ -0,0 +1,22 @@
---
---

# Test

<div> Here's some stuff to

compress</div>


Here's a code block.
Don't compress this!

^ empty line suckas!
What are you going to do about it?
I'm a code block!

OK.

This is probably good enough.

Peace out.
16 changes: 9 additions & 7 deletions test/_config.yml
@@ -1,8 +1,10 @@
name: Your New Jekyll Site
markdown: redcarpet
redcarpet:
smart: false
source: source
plugins: source/_plugins
destination: site
pygments: false
highlighter: false
exclude:
- Gemfile
gems:
- jekyll-minify-html
collections:
collection_test:
output: true

1 change: 1 addition & 0 deletions test/_env-dev.yml
@@ -0,0 +1 @@
env: development
1 change: 1 addition & 0 deletions test/_env-prod.yml
@@ -0,0 +1 @@
env: production
7 changes: 7 additions & 0 deletions test/_expected/compressed/collection_test/test.html
@@ -0,0 +1,7 @@
<h1>Test</h1><div> Here's some stuff to compress</div><div class="highlight"><pre><code class="language-text" data-lang="text">Here's a code block.
Don't compress this!

^ empty line suckas!
What are you going to do about it?
I'm a code block!
</code></pre></div><p>OK.</p><p>This is probably good enough.</p><p>Peace out.</p>
7 changes: 7 additions & 0 deletions test/_expected/compressed/index.html
@@ -0,0 +1,7 @@
<h1>Test</h1><div> Here's some stuff to compress</div><div class="highlight"><pre><code class="language-text" data-lang="text">Here's a code block.
Don't compress this!

^ empty line suckas!
What are you going to do about it?
I'm a code block!
</code></pre></div><p>OK.</p><p>This is probably good enough.</p><p>Peace out.</p>
17 changes: 17 additions & 0 deletions test/_expected/uncompressed/collection_test/test.html
@@ -0,0 +1,17 @@
<h1>Test</h1>

<div> Here's some stuff to

compress</div>
<div class="highlight"><pre><code class="language-text" data-lang="text">Here&#39;s a code block.
Don&#39;t compress this!

^ empty line suckas!
What are you going to do about it?
I&#39;m a code block!
</code></pre></div>
<p>OK.</p>

<p>This is probably good enough.</p>

<p>Peace out.</p>
17 changes: 17 additions & 0 deletions test/_expected/uncompressed/index.html
@@ -0,0 +1,17 @@
<h1>Test</h1>

<div> Here's some stuff to

compress</div>
<div class="highlight"><pre><code class="language-text" data-lang="text">Here&#39;s a code block.
Don&#39;t compress this!

^ empty line suckas!
What are you going to do about it?
I&#39;m a code block!
</code></pre></div>
<p>OK.</p>

<p>This is probably good enough.</p>

<p>Peace out.</p>
1 change: 1 addition & 0 deletions test/_minify-false.yml
@@ -0,0 +1 @@
minify_html: false
1 change: 1 addition & 0 deletions test/_minify-true.yml
@@ -0,0 +1 @@
minify_html: true
2 changes: 0 additions & 2 deletions test/source/index.md → test/index.md
@@ -1,6 +1,4 @@
---
layout: default
title: Your New Jekyll Site
---

# Test
Expand Down
10 changes: 0 additions & 10 deletions test/jekyll-0.12/Gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions test/jekyll-0.12/expected/compressed.html

This file was deleted.

61 changes: 0 additions & 61 deletions test/jekyll-0.12/expected/uncompressed.html

This file was deleted.

10 changes: 0 additions & 10 deletions test/jekyll-1.0/Gemfile

This file was deleted.

7 changes: 0 additions & 7 deletions test/jekyll-1.0/expected/compressed.html

This file was deleted.

61 changes: 0 additions & 61 deletions test/jekyll-1.0/expected/uncompressed.html

This file was deleted.

7 changes: 0 additions & 7 deletions test/site/index.html

This file was deleted.

0 comments on commit 55c92a4

Please sign in to comment.