matflores-jekyll 0.4.3 → 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", "archive_yearly", "archive_monthly", "archive_daily", "category_index"].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", "archive_daily", "archive_monthly", "archive_yearly", "category_index"].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: matflores-jekyll
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
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-03-31 00:00:00 -07: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
@@ -103,40 +103,29 @@ files:
103
103
  - lib/jekyll/archive.rb
104
104
  - lib/jekyll/category_index.rb
105
105
  - lib/jekyll/site.rb
106
- - lib/jekyll/tags
107
106
  - lib/jekyll/tags/highlight.rb
108
107
  - lib/jekyll/tags/include.rb
109
- - lib/jekyll.rb
110
- - test/dest
111
108
  - test/helper.rb
112
- - test/source
113
- - test/source/_includes
114
109
  - test/source/_includes/sig.markdown
115
- - test/source/_layouts
116
110
  - test/source/_layouts/default.html
117
111
  - test/source/_layouts/simple.html
118
- - test/source/_posts
112
+ - test/source/_posts/2008-02-02-not-published.textile
113
+ - test/source/_posts/2008-02-02-published.textile
119
114
  - test/source/_posts/2008-10-18-foo-bar.textile
120
115
  - test/source/_posts/2008-11-21-complex.textile
121
116
  - test/source/_posts/2008-12-03-permalinked-post.textile
122
117
  - test/source/_posts/2008-12-13-include.markdown
123
- - test/source/category
124
- - test/source/category/_posts
118
+ - test/source/_posts/2009-01-27-array-categories.textile
119
+ - test/source/_posts/2009-01-27-categories.textile
120
+ - test/source/_posts/2009-01-27-category.textile
125
121
  - test/source/category/_posts/2008-9-23-categories.textile
126
- - test/source/css
127
122
  - test/source/css/screen.css
128
- - test/source/foo
129
- - test/source/foo/_posts
130
- - test/source/foo/_posts/bar
131
123
  - test/source/foo/_posts/bar/2008-12-12-topical-post.textile
132
124
  - test/source/index.html
133
- - test/source/z_category
134
- - test/source/z_category/_posts
135
125
  - test/source/z_category/_posts/2008-9-23-categories.textile
136
126
  - test/suite.rb
137
127
  - test/test_filters.rb
138
128
  - test/test_generated_site.rb
139
- - test/test_jekyll.rb
140
129
  - test/test_post.rb
141
130
  - test/test_site.rb
142
131
  - test/test_tags.rb
@@ -144,7 +133,6 @@ has_rdoc: true
144
133
  homepage: http://github.com/mojombo/jekyll
145
134
  post_install_message:
146
135
  rdoc_options:
147
- - --inline-source
148
136
  - --charset=UTF-8
149
137
  require_paths:
150
138
  - lib
@@ -167,5 +155,11 @@ rubygems_version: 1.2.0
167
155
  signing_key:
168
156
  specification_version: 2
169
157
  summary: Jekyll is a simple, blog aware, static site generator.
170
- test_files: []
171
-
158
+ test_files:
159
+ - test/helper.rb
160
+ - test/suite.rb
161
+ - test/test_filters.rb
162
+ - test/test_generated_site.rb
163
+ - test/test_post.rb
164
+ - test/test_site.rb
165
+ - test/test_tags.rb
data/test/test_jekyll.rb DELETED
File without changes