File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,11 @@ def run
3434 def rewrite_link ( feed )
3535 new_link = URI . extract ( feed . description , %w{ http https } ) . uniq . last
3636 feed . link = new_link unless new_link . nil?
37+
38+ if @config [ 'clear_description' ] == 1
39+ feed . description = ""
40+ end
41+
3742 feed
3843 end
3944 end
Original file line number Diff line number Diff line change 3535 subject . run
3636 subject . instance_variable_get ( :@pipeline ) [ 0 ] . items [ 0 ] . link .
3737 should == "http://test2.id774.net"
38+ subject . instance_variable_get ( :@pipeline ) [ 0 ] . items [ 0 ] . description .
39+ should == "aaa bbb ccc http://test2.id774.net"
40+ }
41+ end
42+ end
43+
44+ context "It should be empty description if clear_description specified" do
45+
46+ subject {
47+ Automatic ::Plugin ::FilterDescriptionLink . new ( {
48+ 'clear_description' => 1 ,
49+ } ,
50+ AutomaticSpec . generate_pipeline {
51+ feed {
52+ item "http://test1.id774.net" ,
53+ "dummy title" ,
54+ "aaa bbb ccc http://test2.id774.net" ,
55+ "Mon, 07 Mar 2011 15:54:11 +0900"
56+ }
57+ }
58+ )
59+ }
60+
61+ describe "#run" do
62+ its ( :run ) { should have ( 1 ) . feeds }
63+
64+ specify {
65+ subject . run
66+ subject . instance_variable_get ( :@pipeline ) [ 0 ] . items [ 0 ] . link .
67+ should == "http://test2.id774.net"
68+ subject . instance_variable_get ( :@pipeline ) [ 0 ] . items [ 0 ] . description .
69+ should == ""
3870 }
3971 end
4072 end
You can’t perform that action at this time.
0 commit comments