sixones-jekyll 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/test/test_site.rb CHANGED
@@ -1,45 +1,57 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
2
 
3
3
  class TestSite < Test::Unit::TestCase
4
- def setup
5
- @source = File.join(File.dirname(__FILE__), *%w[source])
6
- @s = Site.new(@source, dest_dir)
7
- end
8
-
9
- def test_site_init
10
-
11
- end
12
-
13
- def test_read_layouts
14
- @s.read_layouts
15
-
16
- assert_equal ["default", "simple"].sort, @s.layouts.keys.sort
17
- end
18
-
19
- def test_read_posts
20
- @s.read_posts('')
21
- posts = Dir[File.join(@source, '_posts/*')]
22
- assert_equal posts.size - 1, @s.posts.size
23
- end
24
-
25
- def test_site_payload
26
- clear_dest
27
- @s.process
28
-
29
- posts = Dir[File.join(@source, "**", "_posts/*")]
30
- categories = %w(bar baz category foo z_category publish_test).sort
31
-
32
- assert_equal posts.size - 1, @s.posts.size
33
- assert_equal categories, @s.categories.keys.sort
34
- assert_equal 4, @s.categories['foo'].size
35
- end
4
+ context "creating sites" do
5
+ setup do
6
+ stub(Jekyll).configuration do
7
+ Jekyll::DEFAULTS.merge({'source' => source_dir, 'destination' => dest_dir})
8
+ end
9
+ @site = Site.new(Jekyll.configuration)
10
+ end
11
+
12
+ should "reset data before processing" do
13
+ clear_dest
14
+ @site.process
15
+ before_posts = @site.posts.length
16
+ before_layouts = @site.layouts.length
17
+ before_categories = @site.categories.length
18
+
19
+ @site.process
20
+ assert_equal before_posts, @site.posts.length
21
+ assert_equal before_layouts, @site.layouts.length
22
+ assert_equal before_categories, @site.categories.length
23
+ end
24
+
25
+ should "read layouts" do
26
+ @site.read_layouts
27
+ assert_equal ["default", "simple"].sort, @site.layouts.keys.sort
28
+ end
29
+
30
+ should "read posts" do
31
+ @site.read_posts('')
32
+ posts = Dir[source_dir('_posts', '*')]
33
+ assert_equal posts.size - 1, @site.posts.size
34
+ end
35
+
36
+ should "deploy payload" do
37
+ clear_dest
38
+ @site.process
39
+
40
+ posts = Dir[source_dir("**", "_posts", "*")]
41
+ categories = %w(bar baz category foo z_category publish_test).sort
42
+
43
+ assert_equal posts.size - 1, @site.posts.size
44
+ assert_equal categories, @site.categories.keys.sort
45
+ assert_equal 4, @site.categories['foo'].size
46
+ end
36
47
 
37
- def test_filter_entries
38
- ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
48
+ should "filter entries" do
49
+ ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
39
50
  .baz.markdow foo.markdown~]
40
- ent2 = %w[.htaccess _posts bla.bla]
51
+ ent2 = %w[.htaccess _posts bla.bla]
41
52
 
42
- assert_equal %w[foo.markdown bar.markdown baz.markdown], @s.filter_entries(ent1)
43
- assert_equal ent2, @s.filter_entries(ent2)
53
+ assert_equal %w[foo.markdown bar.markdown baz.markdown], @site.filter_entries(ent1)
54
+ assert_equal ent2, @site.filter_entries(ent2)
55
+ end
44
56
  end
45
57
  end
data/test/test_tags.rb CHANGED
@@ -1,15 +1,16 @@
1
1
  require File.dirname(__FILE__) + '/helper'
2
2
 
3
3
  class TestTags < Test::Unit::TestCase
4
-
5
- def setup
6
- @content = <<CONTENT
4
+ context "tagging" do
5
+ setup do
6
+ @content = <<CONTENT
7
7
  ---
8
8
  layout: post
9
9
  title: This is a test
10
10
 
11
11
  ---
12
12
  This document results in a markdown error with maruku
13
+
13
14
  {% highlight ruby %}
14
15
  puts "hi"
15
16
 
@@ -17,15 +18,18 @@ puts "bye"
17
18
  {% endhighlight %}
18
19
 
19
20
  CONTENT
20
- end
21
-
22
- def test_markdown_with_pygments_line_handling
23
- Jekyll.pygments = true
24
- Jekyll.content_type = :markdown
25
-
26
- result = Liquid::Template.parse(@content).render({}, [Jekyll::Filters])
27
- result = Jekyll.markdown_proc.call(result)
28
- assert_no_match(/markdown\-html\-error/,result)
21
+ end
22
+
23
+ should "render markdown with pygments line handling" do
24
+ stub(Jekyll).configuration do
25
+ Jekyll::DEFAULTS.merge({'pygments' => true})
26
+ end
27
+ site = Site.new(Jekyll.configuration)
28
+ info = { :filters => [Jekyll::Filters], :registers => { :site => site } }
29
+
30
+ result = Liquid::Template.parse(@content).render({}, info)
31
+ result = site.markdown(result)
32
+ assert_no_match(/markdown\-html\-error/,result)
33
+ end
29
34
  end
30
-
31
35
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sixones-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Preston-Werner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-10 00:00:00 -08:00
12
+ date: 2009-04-07 00:00:00 -07:00
13
13
  default_executable: jekyll
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -78,16 +78,16 @@ executables:
78
78
  - jekyll
79
79
  extensions: []
80
80
 
81
- extra_rdoc_files: []
82
-
81
+ extra_rdoc_files:
82
+ - README.textile
83
83
  files:
84
84
  - History.txt
85
85
  - README.textile
86
+ - Rakefile
86
87
  - VERSION.yml
87
88
  - bin/jekyll
88
- - lib/jekyll
89
+ - lib/jekyll.rb
89
90
  - lib/jekyll/albino.rb
90
- - lib/jekyll/converters
91
91
  - lib/jekyll/converters/csv.rb
92
92
  - lib/jekyll/converters/mephisto.rb
93
93
  - lib/jekyll/converters/mt.rb
@@ -97,87 +97,33 @@ files:
97
97
  - lib/jekyll/convertible.rb
98
98
  - lib/jekyll/core_ext.rb
99
99
  - lib/jekyll/filters.rb
100
- - lib/jekyll/custom_filters.rb
101
100
  - lib/jekyll/layout.rb
102
101
  - lib/jekyll/page.rb
103
102
  - lib/jekyll/post.rb
104
103
  - lib/jekyll/site.rb
105
- - lib/jekyll/tags
106
104
  - lib/jekyll/tags/highlight.rb
107
105
  - lib/jekyll/tags/include.rb
108
- - lib/jekyll.rb
109
- - test/dest
110
- - test/dest/2008
111
- - test/dest/2008/10
112
- - test/dest/2008/10/18
113
- - test/dest/2008/10/18/foo-bar.html
114
- - test/dest/2008/11
115
- - test/dest/2008/11/21
116
- - test/dest/2008/11/21/complex.html
117
- - test/dest/2008/12
118
- - test/dest/2008/12/13
119
- - test/dest/2008/12/13/include.html
120
- - test/dest/_posts
121
- - test/dest/_posts/2008-10-18-foo-bar.html
122
- - test/dest/_posts/2008-11-21-complex.html
123
- - test/dest/_posts/2008-12-03-permalinked-post.html
124
- - test/dest/_posts/2008-12-13-include.html
125
- - test/dest/category
126
- - test/dest/category/2008
127
- - test/dest/category/2008/09
128
- - test/dest/category/2008/09/23
129
- - test/dest/category/2008/09/23/categories.html
130
- - test/dest/category/_posts
131
- - test/dest/category/_posts/2008-9-23-categories.html
132
- - test/dest/css
133
- - test/dest/css/screen.css
134
- - test/dest/foo
135
- - test/dest/foo/2008
136
- - test/dest/foo/2008/12
137
- - test/dest/foo/2008/12/12
138
- - test/dest/foo/2008/12/12/topical-post.html
139
- - test/dest/foo/_posts
140
- - test/dest/foo/_posts/bar
141
- - test/dest/foo/_posts/bar/2008-12-12-topical-post.html
142
- - test/dest/index.html
143
- - test/dest/my_category
144
- - test/dest/my_category/permalinked-post
145
- - test/dest/z_category
146
- - test/dest/z_category/2008
147
- - test/dest/z_category/2008/09
148
- - test/dest/z_category/2008/09/23
149
- - test/dest/z_category/2008/09/23/categories.html
150
- - test/dest/z_category/_posts
151
- - test/dest/z_category/_posts/2008-9-23-categories.html
152
106
  - test/helper.rb
153
- - test/source
154
- - test/source/_includes
155
107
  - test/source/_includes/sig.markdown
156
- - test/source/_layouts
157
108
  - test/source/_layouts/default.html
158
109
  - test/source/_layouts/simple.html
159
- - test/source/_posts
110
+ - test/source/_posts/2008-02-02-not-published.textile
111
+ - test/source/_posts/2008-02-02-published.textile
160
112
  - test/source/_posts/2008-10-18-foo-bar.textile
161
113
  - test/source/_posts/2008-11-21-complex.textile
162
114
  - test/source/_posts/2008-12-03-permalinked-post.textile
163
115
  - test/source/_posts/2008-12-13-include.markdown
164
- - test/source/category
165
- - test/source/category/_posts
116
+ - test/source/_posts/2009-01-27-array-categories.textile
117
+ - test/source/_posts/2009-01-27-categories.textile
118
+ - test/source/_posts/2009-01-27-category.textile
166
119
  - test/source/category/_posts/2008-9-23-categories.textile
167
- - test/source/css
168
120
  - test/source/css/screen.css
169
- - test/source/foo
170
- - test/source/foo/_posts
171
- - test/source/foo/_posts/bar
172
121
  - test/source/foo/_posts/bar/2008-12-12-topical-post.textile
173
122
  - test/source/index.html
174
- - test/source/z_category
175
- - test/source/z_category/_posts
176
123
  - test/source/z_category/_posts/2008-9-23-categories.textile
177
124
  - test/suite.rb
178
125
  - test/test_filters.rb
179
126
  - test/test_generated_site.rb
180
- - test/test_jekyll.rb
181
127
  - test/test_post.rb
182
128
  - test/test_site.rb
183
129
  - test/test_tags.rb
@@ -185,7 +131,6 @@ has_rdoc: true
185
131
  homepage: http://github.com/mojombo/jekyll
186
132
  post_install_message:
187
133
  rdoc_options:
188
- - --inline-source
189
134
  - --charset=UTF-8
190
135
  require_paths:
191
136
  - lib
@@ -208,5 +153,11 @@ rubygems_version: 1.2.0
208
153
  signing_key:
209
154
  specification_version: 2
210
155
  summary: Jekyll is a simple, blog aware, static site generator.
211
- test_files: []
212
-
156
+ test_files:
157
+ - test/helper.rb
158
+ - test/suite.rb
159
+ - test/test_filters.rb
160
+ - test/test_generated_site.rb
161
+ - test/test_post.rb
162
+ - test/test_site.rb
163
+ - test/test_tags.rb
@@ -1,13 +0,0 @@
1
- module Jekyll
2
- module Filters
3
- module Custom
4
- def self.extensions; @@extensions; end
5
-
6
- @@extensions = [ ]
7
-
8
- def self.included(base)
9
- @@extensions << base
10
- end
11
- end
12
- end
13
- end
data/test/test_jekyll.rb DELETED
File without changes