Sha256: a29665def84cfc6616bbe38536def1f4a3d6b374b2d23b2057097f1650a8d01b
Contents?: true
Size: 1.03 KB
Versions: 25
Compression:
Stored size: 1.03 KB
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe TextFilter do class ReverseFilter < TextFilter description %{Reverses text.} def filter(text) text.reverse end end class CustomFilter < TextFilter filter_name "Really Custom" description_file File.dirname(__FILE__) + "/../fixtures/sample.txt" end it 'should allow description annotation' do ReverseFilter.description.should == %{Reverses text.} end it 'should description_file annotation' do CustomFilter.description.should == File.read(File.dirname(__FILE__) + "/../fixtures/sample.txt") end it 'should filter text with base filter' do filter = TextFilter.new filter.filter('test').should == 'test' end it 'should filter text with subclass' do ReverseFilter.filter('test').should == 'tset' end it 'should allow filter_name annotation' do CustomFilter.filter_name.should == 'Really Custom' end it 'should default filter_name annotation' do ReverseFilter.filter_name.should == 'Reverse' end end
Version data entries
25 entries across 25 versions & 3 rubygems