mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									e6021a1be2
								
							
						
					
					
						commit
						d570a76cba
					
				
					 2 changed files with 26 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -1,3 +1,7 @@
 | 
			
		|||
Mon Jul 16 17:05:53 2012  Ayumu AIZAWA  <ayumu.aizawa@gmail.com>
 | 
			
		||||
 | 
			
		||||
	* test/fileutils/test_fileutils.rb: add test for FileUtils#uptodate?
 | 
			
		||||
 | 
			
		||||
Mon Jul 16 16:56:12 2012  Ayumu AIZAWA  <ayumu.aizawa@gmail.com>
 | 
			
		||||
 | 
			
		||||
	* lib/fileutils.rb (public): remove useless parameter.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1117,8 +1117,30 @@ class TestFileUtils
 | 
			
		|||
      uptodate? 'tmp/a', ['tmp/b', Pathname.new('tmp/c')]
 | 
			
		||||
      uptodate? Pathname.new('tmp/a'), [Pathname.new('tmp/b'), Pathname.new('tmp/c')]
 | 
			
		||||
    }
 | 
			
		||||
    # [Bug #6708] [ruby-core:46256]
 | 
			
		||||
    assert_raises_with_message(ArgumentError, "wrong number of arguments (3 for 2)") {
 | 
			
		||||
      uptodate?('new',['old', 'oldest'], {})
 | 
			
		||||
    }
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  def assert_raises_with_message(klass, message)
 | 
			
		||||
    begin
 | 
			
		||||
      yield
 | 
			
		||||
      flunk("Expected Exception #{klass} didn't raise")
 | 
			
		||||
    rescue klass => ex
 | 
			
		||||
      if message.kind_of? String
 | 
			
		||||
        flag = !!(ex.message == message)
 | 
			
		||||
        assert(flag, "Expected Exception(#{klass}) was raised, but the message doesn't match")
 | 
			
		||||
      elsif message.kind_of? Regexp
 | 
			
		||||
        flag = !!(ex.message =~ message)
 | 
			
		||||
        assert(flag, "Expected Exception(#{klass}) was raised, but the message doesn't match")
 | 
			
		||||
      else
 | 
			
		||||
        raise
 | 
			
		||||
      end
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
  private :assert_raises_with_message
 | 
			
		||||
 | 
			
		||||
  def test_cd
 | 
			
		||||
    check_singleton :cd
 | 
			
		||||
  end
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue