Skip to content

Commit f92a718

Browse files
committed
152 RSpec for Publish::Dump
1 parent 2c6992c commit f92a718

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ bin/decolor
1010
bin/erubis
1111
bin/feedbag
1212
bin/htmldiff
13-
bin/hpricot
1413
bin/jeweler
1514
bin/ldiff
1615
bin/mocksmtpd
16+
bin/nokogiri
1717
bin/rackup
1818
bin/rcov
1919
bin/rdoc

spec/plugins/publish/dump_spec.rb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# -*- coding: utf-8 -*-
2+
# Name:: Automatic::Plugin::Publish::Dump
3+
# Author:: 774 <http://id774.net>
4+
# Created:: Jun 13, 2012
5+
# Updated:: Jun 13, 2012
6+
# Copyright:: 774 Copyright (c) 2012
7+
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8+
#
9+
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
10+
11+
require 'publish/dump'
12+
13+
describe Automatic::Plugin::PublishDump do
14+
15+
context "with contain normal HTML" do
16+
subject {
17+
Automatic::Plugin::PublishDump.new({},
18+
AutomaticSpec.generate_pipeline {
19+
html "publishDump.html"
20+
}
21+
)}
22+
23+
describe "#run" do
24+
its(:run) { should have(1).feeds }
25+
specify {
26+
subject.run
27+
expect = "<!DOCTYPE html>\n<html lang=\"ja\">\n <head>\n <title>Sample</title>\n </head>\n <body>\n <p>A simple <b>test</b> string.</p>\n <a href=\"http://id774.net\">id774.net</a>\n <a href=\"http://reblog.id774.net\">reblog.id774.net</a>\n <a href=\"http://oh-news.net/live/wp-content/uploads/2011/04/Eila_omote.jpg\">\n <img src=\"http://24.media.tumblr.com/tumblr_m5gneyJmsH1qza5ppo1_500.jpg\" alt=\"\" />\n <a href=\"http://blog.id774.net/post/\">blog.id774.net</a>\n </body>\n</html>\n"
28+
subject.instance_variable_get(:@pipeline)[0].should == expect
29+
}
30+
end
31+
end
32+
end

test/fixtures/publishDump.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html lang="ja">
3+
<head>
4+
<title>Sample</title>
5+
</head>
6+
<body>
7+
<p>A simple <b>test</b> string.</p>
8+
<a href="http://id774.net">id774.net</a>
9+
<a href="http://reblog.id774.net">reblog.id774.net</a>
10+
<a href="http://oh-news.net/live/wp-content/uploads/2011/04/Eila_omote.jpg">
11+
<img src="http://24.media.tumblr.com/tumblr_m5gneyJmsH1qza5ppo1_500.jpg" alt="" />
12+
<a href="http://blog.id774.net/post/">blog.id774.net</a>
13+
</body>
14+
</html>

0 commit comments

Comments
 (0)