myobie-turbine-core 0.5.2 → 0.5.3
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/VERSION.yml +1 -1
- data/lib/turbine-core/types/quote.rb +1 -1
- data/spec/post_types/article_spec.rb +22 -0
- data/spec/post_types/quote_spec.rb +1 -1
- metadata +4 -2
data/VERSION.yml
CHANGED
@@ -33,6 +33,6 @@ class Quote < PostType
|
|
33
33
|
markdown = Markdown.new(the_quote[:quote])
|
34
34
|
quote_html = markdown.text.blank? ? "" : markdown.to_html.strip
|
35
35
|
|
36
|
-
!(text =~ /Quote: (.*)/).
|
36
|
+
!(text =~ /Quote: (.*)/).blank? || !(quote_html.split("\n").first =~ /^<blockquote(.+)<\/blockquote>$/m).blank?
|
37
37
|
end
|
38
38
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '../spec_helper.rb')
|
2
|
+
|
3
|
+
describe Chat do
|
4
|
+
|
5
|
+
before do
|
6
|
+
class Yellow; end
|
7
|
+
Object.send(:remove_const, :Yellow)
|
8
|
+
end
|
9
|
+
|
10
|
+
should "pull the title out of an article" do
|
11
|
+
Article.new("Hello\n=====\n\nWorld").get_attr(:title).should == "Hello"
|
12
|
+
end
|
13
|
+
|
14
|
+
should "allow quotes in articles" do
|
15
|
+
Article.new("Hello\n=====\n\nThis has a quote in it.\n\n> This is the quote\n> \n> And the rest of the quote\n\nAnd the rest of the article").get_attr(:body, false).should == "This has a quote in it.\n\n> This is the quote\n> \n> And the rest of the quote\n\nAnd the rest of the article"
|
16
|
+
end
|
17
|
+
|
18
|
+
should "know that an article with a quote in it is not a Quote" do
|
19
|
+
PostType.auto_detect("Hello\n=====\n\nThis has a quote in it.\n\n> This is the quote\n> \n> And the rest of the quote\n\nAnd the rest of the article").should.be.kind_of Article
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -6,7 +6,7 @@ describe Quote do
|
|
6
6
|
@good_quote = "> This should be a quote."
|
7
7
|
@good_quote_with_source = "Source: George Washington\n\n> This is what he said."
|
8
8
|
@good_quote_all_pairs = "Quote: Hello\nSource: Me"
|
9
|
-
@bad_quote = "
|
9
|
+
@bad_quote = "URL: google.com\nTitle: Hello"
|
10
10
|
|
11
11
|
class Yellow; end
|
12
12
|
Object.send(:remove_const, :Yellow)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: myobie-turbine-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Herald
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-04
|
12
|
+
date: 2009-05-04 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -39,6 +39,7 @@ files:
|
|
39
39
|
- lib/turbine-core/types/review.rb
|
40
40
|
- lib/turbine-core/types/video.rb
|
41
41
|
- spec/general/post_type_spec.rb
|
42
|
+
- spec/post_types/article_spec.rb
|
42
43
|
- spec/post_types/chat_spec.rb
|
43
44
|
- spec/post_types/link_spec.rb
|
44
45
|
- spec/post_types/quote_spec.rb
|
@@ -74,6 +75,7 @@ specification_version: 2
|
|
74
75
|
summary: TODO
|
75
76
|
test_files:
|
76
77
|
- spec/general/post_type_spec.rb
|
78
|
+
- spec/post_types/article_spec.rb
|
77
79
|
- spec/post_types/chat_spec.rb
|
78
80
|
- spec/post_types/link_spec.rb
|
79
81
|
- spec/post_types/quote_spec.rb
|