codeslinger-jekyll 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/test/test_post.rb CHANGED
@@ -25,7 +25,6 @@ class TestPost < Test::Unit::TestCase
25
25
  assert !Post.valid?("blah")
26
26
  end
27
27
 
28
-
29
28
  context "processing posts" do
30
29
  setup do
31
30
  @post = Post.allocate
@@ -69,6 +68,19 @@ class TestPost < Test::Unit::TestCase
69
68
  assert_equal "my_category/permalinked-post", @post.url
70
69
  end
71
70
 
71
+ context "with CRLF linebreaks" do
72
+ setup do
73
+ @real_file = "2009-05-24-yaml-linebreak.markdown"
74
+ @source = source_dir('win/_posts')
75
+ end
76
+ should "read yaml front-matter" do
77
+ @post.read_yaml(@source, @real_file)
78
+
79
+ assert_equal({"title" => "Test title", "layout" => "post", "tag" => "Ruby"}, @post.data)
80
+ assert_equal "\r\nThis is the content", @post.content
81
+ end
82
+ end
83
+
72
84
  context "with site wide permalink" do
73
85
  setup do
74
86
  @post.categories = []
@@ -129,8 +141,8 @@ class TestPost < Test::Unit::TestCase
129
141
  end
130
142
 
131
143
  should "process the url correctly" do
132
- assert_equal "/:categories/:year/:month/:day/:title", @post.template
133
- assert_equal "/2008/10/19/foo-bar", @post.url
144
+ assert_equal "/:categories/:year/:month/:day/:title/", @post.template
145
+ assert_equal "/2008/10/19/foo-bar/", @post.url
134
146
  end
135
147
  end
136
148
 
@@ -212,6 +224,28 @@ class TestPost < Test::Unit::TestCase
212
224
  assert post.categories.include?('baz')
213
225
  end
214
226
 
227
+ should "recognize tag in yaml" do
228
+ post = setup_post("2009-05-18-tag.textile")
229
+ assert post.tags.include?('code')
230
+ end
231
+
232
+ should "recognize tags in yaml" do
233
+ post = setup_post("2009-05-18-tags.textile")
234
+ assert post.tags.include?('food')
235
+ assert post.tags.include?('cooking')
236
+ assert post.tags.include?('pizza')
237
+ end
238
+
239
+ should "allow no yaml" do
240
+ post = setup_post("2009-06-22-no-yaml.textile")
241
+ assert_equal "No YAML.", post.content
242
+ end
243
+
244
+ should "allow empty yaml" do
245
+ post = setup_post("2009-06-22-empty-yaml.textile")
246
+ assert_equal "Empty YAML.", post.content
247
+ end
248
+
215
249
  context "rendering" do
216
250
  setup do
217
251
  clear_dest
@@ -262,7 +296,6 @@ class TestPost < Test::Unit::TestCase
262
296
  should "generate categories and topics" do
263
297
  post = Post.new(@site, File.join(File.dirname(__FILE__), *%w[source]), 'foo', 'bar/2008-12-12-topical-post.textile')
264
298
  assert_equal ['foo'], post.categories
265
- assert_equal ['bar'], post.topics
266
299
  end
267
300
 
268
301
  end
data/test/test_site.rb CHANGED
@@ -9,6 +9,10 @@ class TestSite < Test::Unit::TestCase
9
9
  @site = Site.new(Jekyll.configuration)
10
10
  end
11
11
 
12
+ should "have an empty tag hash by default" do
13
+ assert_equal Hash.new, @site.tags
14
+ end
15
+
12
16
  should "reset data before processing" do
13
17
  clear_dest
14
18
  @site.process
@@ -38,7 +42,7 @@ class TestSite < Test::Unit::TestCase
38
42
  @site.process
39
43
 
40
44
  posts = Dir[source_dir("**", "_posts", "*")]
41
- categories = %w(bar baz category foo z_category publish_test).sort
45
+ categories = %w(bar baz category foo z_category publish_test win).sort
42
46
 
43
47
  assert_equal posts.size - 1, @site.posts.size
44
48
  assert_equal categories, @site.categories.keys.sort
@@ -61,5 +65,21 @@ class TestSite < Test::Unit::TestCase
61
65
  @site.exclude = excludes
62
66
  assert_equal includes, @site.filter_entries(excludes + includes)
63
67
  end
68
+
69
+ context 'with an invalid markdown processor in the configuration' do
70
+
71
+ should 'give a meaningful error message' do
72
+ bad_processor = 'not a processor name'
73
+ begin
74
+ Site.new(Jekyll.configuration.merge({ 'markdown' => bad_processor }))
75
+ flunk 'Invalid markdown processors should cause a failure on site creation'
76
+ rescue RuntimeError => e
77
+ assert e.to_s =~ /invalid|bad/i
78
+ assert e.to_s =~ %r{#{bad_processor}}
79
+ end
80
+ end
81
+
82
+ end
83
+
64
84
  end
65
85
  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.5.1
4
+ version: 0.5.2
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-05-06 00:00:00 -07:00
12
+ date: 2009-06-24 00:00:00 -07:00
13
13
  default_executable: jekyll
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -18,9 +18,9 @@ dependencies:
18
18
  version_requirement:
19
19
  version_requirements: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - "="
21
+ - - ">="
22
22
  - !ruby/object:Gem::Version
23
- version: 4.1.0
23
+ version: 4.2.1
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: liquid
@@ -81,11 +81,22 @@ extensions: []
81
81
  extra_rdoc_files:
82
82
  - README.textile
83
83
  files:
84
+ - .gitignore
84
85
  - History.txt
85
86
  - README.textile
86
87
  - Rakefile
87
88
  - VERSION.yml
88
89
  - bin/jekyll
90
+ - features/create_sites.feature
91
+ - features/embed_filters.feature
92
+ - features/pagination.feature
93
+ - features/permalinks.feature
94
+ - features/post_data.feature
95
+ - features/site_configuration.feature
96
+ - features/site_data.feature
97
+ - features/step_definitions/jekyll_steps.rb
98
+ - features/support/env.rb
99
+ - jekyll.gemspec
89
100
  - lib/jekyll.rb
90
101
  - lib/jekyll/albino.rb
91
102
  - lib/jekyll/converters/csv.rb
@@ -99,6 +110,7 @@ files:
99
110
  - lib/jekyll/filters.rb
100
111
  - lib/jekyll/layout.rb
101
112
  - lib/jekyll/page.rb
113
+ - lib/jekyll/pager.rb
102
114
  - lib/jekyll/post.rb
103
115
  - lib/jekyll/site.rb
104
116
  - lib/jekyll/tags/highlight.rb
@@ -117,18 +129,28 @@ files:
117
129
  - test/source/_posts/2009-01-27-categories.textile
118
130
  - test/source/_posts/2009-01-27-category.textile
119
131
  - test/source/_posts/2009-03-12-hash-#1.markdown
132
+ - test/source/_posts/2009-05-18-tag.textile
133
+ - test/source/_posts/2009-05-18-tags.textile
134
+ - test/source/_posts/2009-06-22-empty-yaml.textile
135
+ - test/source/_posts/2009-06-22-no-yaml.textile
136
+ - test/source/about.html
120
137
  - test/source/category/_posts/2008-9-23-categories.textile
138
+ - test/source/contacts.html
121
139
  - test/source/css/screen.css
122
140
  - test/source/foo/_posts/bar/2008-12-12-topical-post.textile
123
141
  - test/source/index.html
142
+ - test/source/win/_posts/2009-05-24-yaml-linebreak.markdown
124
143
  - test/source/z_category/_posts/2008-9-23-categories.textile
125
144
  - test/suite.rb
145
+ - test/test_configuration.rb
126
146
  - test/test_filters.rb
127
147
  - test/test_generated_site.rb
148
+ - test/test_page.rb
149
+ - test/test_pager.rb
128
150
  - test/test_post.rb
129
151
  - test/test_site.rb
130
152
  - test/test_tags.rb
131
- has_rdoc: true
153
+ has_rdoc: false
132
154
  homepage: http://github.com/mojombo/jekyll
133
155
  post_install_message:
134
156
  rdoc_options:
@@ -152,13 +174,16 @@ requirements: []
152
174
  rubyforge_project: jekyll
153
175
  rubygems_version: 1.2.0
154
176
  signing_key:
155
- specification_version: 2
177
+ specification_version: 3
156
178
  summary: Jekyll is a simple, blog aware, static site generator.
157
179
  test_files:
158
180
  - test/helper.rb
159
181
  - test/suite.rb
182
+ - test/test_configuration.rb
160
183
  - test/test_filters.rb
161
184
  - test/test_generated_site.rb
185
+ - test/test_page.rb
186
+ - test/test_pager.rb
162
187
  - test/test_post.rb
163
188
  - test/test_site.rb
164
189
  - test/test_tags.rb