hentry_consumer 0.3.2 → 0.4.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/README.md
CHANGED
@@ -17,6 +17,7 @@ module HentryConsumer
|
|
17
17
|
def to_html
|
18
18
|
self.entries.collect(&:to_html).join
|
19
19
|
end
|
20
|
+
alias_method :to_s, :to_html
|
20
21
|
|
21
22
|
def to_json(*a)
|
22
23
|
json = {:items =>
|
@@ -26,6 +27,6 @@ module HentryConsumer
|
|
26
27
|
}]
|
27
28
|
}.to_json(a)
|
28
29
|
end
|
29
|
-
|
30
|
+
|
30
31
|
end
|
31
32
|
end
|
@@ -12,15 +12,19 @@ describe HentryConsumer::HFeed do
|
|
12
12
|
it { json["items"].first["properties"]["entries"].first["items"].first["type"].should include "h-entry" }
|
13
13
|
|
14
14
|
end
|
15
|
-
|
16
|
-
|
15
|
+
|
16
|
+
describe "to_s" do
|
17
|
+
let(:string) { feed.to_s }
|
18
|
+
it "should have nicely formatted content" do
|
19
|
+
string.should match feed.to_html
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
17
23
|
describe "html" do
|
18
|
-
|
19
|
-
let(:html) { feed.to_html }
|
24
|
+
let(:html) { feed.to_html }
|
20
25
|
|
21
|
-
|
22
|
-
|
23
|
-
end
|
26
|
+
it "should match the example html" do
|
27
|
+
html.gsub(/\\n|\s/, '').should eq File.open("spec/support/example.html").read.gsub(/\\n|\s/, '')
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hentry_consumer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|