Sha256: 89b3faf1f4a40464adcafe42b6f9a549f541a320536422d7e128d496d087dc7b

Contents?: true

Size: 866 Bytes

Versions: 4

Compression:

Stored size: 866 Bytes

Contents

require File.join(File.dirname(__FILE__), 'test_helper')

#test filter
module ConsoleUpdate
  class Filter
    module Test
    end
  end
end

# class ConsoleUpdate::FilterTest < Test::Unit::TestCase
describe "Filter" do
  it "incorrect filter name raises FilterNotFoundError" do
    should.raise(ConsoleUpdate::Filter::FilterNotFoundError) {
      ConsoleUpdate::Filter.new(:blah)
    }
  end
  
  it "filter without proper methods raises AbstractMethodError" do
    should.raise(ConsoleUpdate::Filter::AbstractMethodError) {
      ConsoleUpdate::Filter.new(:test).string_to_hashes('blah')
    }    
  end

  it "extends filter for a non-lowercase filter name correctly" do
    filter_meta_class = ConsoleUpdate::Filter.new("Test").instance_eval("class<<self; self;end")
    filter_meta_class.ancestors.include?(ConsoleUpdate::Filter::Test).should == true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
console_update-0.1.6 test/filter_test.rb
console_update-0.1.5 test/filter_test.rb
console_update-0.1.4 test/filter_test.rb
console_update-0.1.3 test/filter_test.rb