forked from id774/automaticruby
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtext_spec.rb
More file actions
84 lines (68 loc) · 2.09 KB
/
text_spec.rb
File metadata and controls
84 lines (68 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# -*- coding: utf-8 -*-
# Name:: Automatic::Plugin::Subscription::Text
# Author:: soramugi <http://soramugi.net>
# 774 <http://id774.net>
# Created:: May 6, 2013
# Updated:: Feb 19, 2014
# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
require 'subscription/text'
describe Automatic::Plugin::SubscriptionText do
context "with empty titles" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'titles' => [] }
)
}
its(:run) { should be_empty }
end
context "with titles whose return feed" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'titles' => ["hugehuge"] }
)
}
its(:run) { should have(1).feed }
end
context "with urls whose return feed" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'urls' => ["http://hugehuge"] }
)
}
its(:run) { should have(1).feed }
end
context "with feeds whose return feed" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'feeds' => [ {'title' => 'huge', 'url' => "http://hugehuge"} ] }
)
}
its(:run) { should have(1).feed }
end
context "with feeds including full fields whose return feed" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'feeds' => [ {'title' => 'huge', 'url' => "http://hugehuge", 'description' => "aaa", 'comments' => "bbb", 'author' => "ccc" } ] }
)
}
its(:run) { should have(1).feed }
end
context "with file whose return feed" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'files' => ["spec/fixtures/sampleFeeds.tsv"] }
)
}
its(:run) { should have(1).feed }
end
context "with files whose return feed" do
subject {
Automatic::Plugin::SubscriptionText.new(
{ 'files' => ["spec/fixtures/sampleFeeds.tsv", "spec/fixtures/sampleFeeds2.tsv"] }
)
}
its(:run) { should have(1).feed }
end
end