Skip to content

Commit 800a1d9

Browse files
committed
#145 Add Plugin Filter::Clear
1 parent 0be2e41 commit 800a1d9

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

plugins/filter/clear.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
# Name:: Automatic::Plugin::Filter::Clear
3+
# Author:: 774 <http://id774.net>
4+
# Created:: Oct 20, 2014
5+
# Updated:: Oct 20, 2014
6+
# Copyright:: Copyright (c) 2014 Automatic Ruby Developers.
7+
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.
8+
9+
module Automatic::Plugin
10+
class FilterClear
11+
def initialize(config, pipeline=[])
12+
@config = config
13+
@pipeline = pipeline
14+
end
15+
16+
def run
17+
[]
18+
end
19+
end
20+
end

spec/plugins/filter/clear_spec.rb

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# -*- coding: utf-8 -*-
2+
# Name:: Automatic::Plugin::Filter::Clear
3+
# Author:: 774 <http://id774.net>
4+
# Created:: Oct 20, 2014
5+
# Updated:: Oct 20, 2014
6+
# Copyright:: Copyright (c) 2014 Automatic Ruby Developers.
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 'filter/clear'
12+
13+
describe Automatic::Plugin::FilterClear do
14+
15+
context "should be cleared" do
16+
subject {
17+
Automatic::Plugin::FilterClear.new({
18+
},
19+
AutomaticSpec.generate_pipeline {
20+
feed {
21+
item "http://hogefuga.com", "",
22+
"aaaabbbccc"
23+
}
24+
feed {
25+
item "http://aaaabbbccc.com", "",
26+
"hogefugahoge"
27+
}
28+
feed {
29+
item "http://aaabbbccc.com", "",
30+
"aaaaaaaaaacccdd"
31+
}
32+
feed {
33+
item "http://aaccc.com", "",
34+
"aaaabbbccc"
35+
item "http://aabbccc.com", "",
36+
"aabbbccc"
37+
}
38+
feed {
39+
item "http://cccddd.com", "",
40+
"aabbbcccdd"
41+
}
42+
}
43+
)}
44+
45+
describe "#run" do
46+
its(:run) { should have(0).feeds }
47+
end
48+
end
49+
end

0 commit comments

Comments
 (0)