mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	test_find.rb: improve branch coverage
* test/test_find.rb (test_to_path): add a test for to_path conversion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									16759238ad
								
							
						
					
					
						commit
						917bc68772
					
				
					 1 changed files with 17 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -297,6 +297,23 @@ class TestFind < Test::Unit::TestCase
 | 
			
		|||
    }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def test_to_path
 | 
			
		||||
    c = Class.new {
 | 
			
		||||
      def initialize(path)
 | 
			
		||||
        @path = path
 | 
			
		||||
      end
 | 
			
		||||
 | 
			
		||||
      def to_path
 | 
			
		||||
        @path
 | 
			
		||||
      end
 | 
			
		||||
    }
 | 
			
		||||
    Dir.mktmpdir {|d|
 | 
			
		||||
      a = []
 | 
			
		||||
      Find.find(c.new(d)) {|f| a << f }
 | 
			
		||||
      assert_equal([d], a)
 | 
			
		||||
    }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  class TestInclude < Test::Unit::TestCase
 | 
			
		||||
    include Find
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue