1 require File.dirname(__FILE__) + '/../spec_helper'
4 class ReverseFilter < TextFilter
5 description %{Reverses text.}
11 class CustomFilter < TextFilter
12 filter_name "Really Custom"
13 description_file File.dirname(__FILE__) + "/../fixtures/sample.txt"
16 it 'should allow description annotation' do
17 ReverseFilter.description.should == %{Reverses text.}
20 it 'should description_file annotation' do
21 CustomFilter.description.should == File.read(File.dirname(__FILE__) + "/../fixtures/sample.txt")
24 it 'should filter text with base filter' do
25 filter = TextFilter.new
26 filter.filter('test').should == 'test'
29 it 'should filter text with subclass' do
30 ReverseFilter.filter('test').should == 'tset'
33 it 'should allow filter_name annotation' do
34 CustomFilter.filter_name.should == 'Really Custom'
37 it 'should default filter_name annotation' do
38 ReverseFilter.filter_name.should == 'Reverse'