test/test_sources.rb in pdd-0.2.1 vs test/test_sources.rb in pdd-0.2.2

- old
+ new

@@ -46,6 +46,25 @@ File.write(File.join(dir, 'd.png'), '') list = PDD::Sources.new(dir).fetch assert_equal 1, list.size end end + + def test_detects_all_text_files + Dir.mktmpdir 'test' do |dir| + exts = %w[(xsl java rb cpp apt)] + exts.each do |ext| + File.write(File.join(dir, "test.#{ext}"), 'text') + end + list = PDD::Sources.new(dir).fetch + assert_equal exts.size, list.size + end + end + + def test_detects_xml_file + Dir.mktmpdir 'test' do |dir| + File.write(File.join(dir, 'a.xml'), '<?xml version="1.0"?><hello/>') + list = PDD::Sources.new(dir).fetch + assert_equal 1, list.size + end + end end