codeslinger-jekyll 0.4.1 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_site.rb CHANGED
@@ -1,33 +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
-
22
- assert_equal 4, @s.posts.size
23
- end
24
-
25
- def test_site_payload
26
- clear_dest
27
- @s.process
28
-
29
- assert_equal 7, @s.posts.length
30
- assert_equal ["category", "foo", "z_category"].sort, @s.categories.keys.sort
31
- assert_equal 1, @s.categories['foo'].length
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
47
+
48
+ should "filter entries" do
49
+ ent1 = %w[foo.markdown bar.markdown baz.markdown #baz.markdown#
50
+ .baz.markdow foo.markdown~]
51
+ ent2 = %w[.htaccess _posts bla.bla]
52
+
53
+ assert_equal %w[foo.markdown bar.markdown baz.markdown], @site.filter_entries(ent1)
54
+ assert_equal ent2, @site.filter_entries(ent2)
55
+ end
32
56
  end
33
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: codeslinger-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
@@ -101,82 +101,29 @@ files:
101
101
  - lib/jekyll/page.rb
102
102
  - lib/jekyll/post.rb
103
103
  - lib/jekyll/site.rb
104
- - lib/jekyll/tags
105
104
  - lib/jekyll/tags/highlight.rb
106
105
  - lib/jekyll/tags/include.rb
107
- - lib/jekyll.rb
108
- - test/dest
109
- - test/dest/2008
110
- - test/dest/2008/10
111
- - test/dest/2008/10/18
112
- - test/dest/2008/10/18/foo-bar.html
113
- - test/dest/2008/11
114
- - test/dest/2008/11/21
115
- - test/dest/2008/11/21/complex.html
116
- - test/dest/2008/12
117
- - test/dest/2008/12/13
118
- - test/dest/2008/12/13/include.html
119
- - test/dest/_posts
120
- - test/dest/_posts/2008-10-18-foo-bar.html
121
- - test/dest/_posts/2008-11-21-complex.html
122
- - test/dest/_posts/2008-12-03-permalinked-post.html
123
- - test/dest/_posts/2008-12-13-include.html
124
- - test/dest/category
125
- - test/dest/category/2008
126
- - test/dest/category/2008/09
127
- - test/dest/category/2008/09/23
128
- - test/dest/category/2008/09/23/categories.html
129
- - test/dest/category/_posts
130
- - test/dest/category/_posts/2008-9-23-categories.html
131
- - test/dest/css
132
- - test/dest/css/screen.css
133
- - test/dest/foo
134
- - test/dest/foo/2008
135
- - test/dest/foo/2008/12
136
- - test/dest/foo/2008/12/12
137
- - test/dest/foo/2008/12/12/topical-post.html
138
- - test/dest/foo/_posts
139
- - test/dest/foo/_posts/bar
140
- - test/dest/foo/_posts/bar/2008-12-12-topical-post.html
141
- - test/dest/index.html
142
- - test/dest/my_category
143
- - test/dest/my_category/permalinked-post
144
- - test/dest/z_category
145
- - test/dest/z_category/2008
146
- - test/dest/z_category/2008/09
147
- - test/dest/z_category/2008/09/23
148
- - test/dest/z_category/2008/09/23/categories.html
149
- - test/dest/z_category/_posts
150
- - test/dest/z_category/_posts/2008-9-23-categories.html
151
106
  - test/helper.rb
152
- - test/source
153
- - test/source/_includes
154
107
  - test/source/_includes/sig.markdown
155
- - test/source/_layouts
156
108
  - test/source/_layouts/default.html
157
109
  - test/source/_layouts/simple.html
158
- - test/source/_posts
110
+ - test/source/_posts/2008-02-02-not-published.textile
111
+ - test/source/_posts/2008-02-02-published.textile
159
112
  - test/source/_posts/2008-10-18-foo-bar.textile
160
113
  - test/source/_posts/2008-11-21-complex.textile
161
114
  - test/source/_posts/2008-12-03-permalinked-post.textile
162
115
  - test/source/_posts/2008-12-13-include.markdown
163
- - test/source/category
164
- - 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
165
119
  - test/source/category/_posts/2008-9-23-categories.textile
166
- - test/source/css
167
120
  - test/source/css/screen.css
168
- - test/source/foo
169
- - test/source/foo/_posts
170
- - test/source/foo/_posts/bar
171
121
  - test/source/foo/_posts/bar/2008-12-12-topical-post.textile
172
122
  - test/source/index.html
173
- - test/source/z_category
174
- - test/source/z_category/_posts
175
123
  - test/source/z_category/_posts/2008-9-23-categories.textile
176
124
  - test/suite.rb
177
125
  - test/test_filters.rb
178
126
  - test/test_generated_site.rb
179
- - test/test_jekyll.rb
180
127
  - test/test_post.rb
181
128
  - test/test_site.rb
182
129
  - test/test_tags.rb
@@ -184,7 +131,6 @@ has_rdoc: true
184
131
  homepage: http://github.com/mojombo/jekyll
185
132
  post_install_message:
186
133
  rdoc_options:
187
- - --inline-source
188
134
  - --charset=UTF-8
189
135
  require_paths:
190
136
  - lib
@@ -207,5 +153,11 @@ rubygems_version: 1.2.0
207
153
  signing_key:
208
154
  specification_version: 2
209
155
  summary: Jekyll is a simple, blog aware, static site generator.
210
- test_files: []
211
-
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
data/test/test_jekyll.rb DELETED
File without changes