From 94caa8a48f32ed1fd3aa38dc43e2add97026fcf2 Mon Sep 17 00:00:00 2001 From: luke Date: Fri, 28 Apr 2006 16:18:21 +0000 Subject: Fixing #128. md5lite was being used instead of full md5. At this point, md5lite cannot be used for source copies. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1146 980ebf18-57e1-0310-9a29-db15c13687c0 --- test/types/file.rb | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test') diff --git a/test/types/file.rb b/test/types/file.rb index 04993db82..2eeb2b2a5 100644 --- a/test/types/file.rb +++ b/test/types/file.rb @@ -1116,6 +1116,32 @@ class TestFile < Test::Unit::TestCase assert_equal(0440, filemode(bucketedpath)) end + + def test_largefilechanges + source = tempfile() + dest = tempfile() + + # Now make a large file + File.open(source, "w") { |f| + 500.times { |i| f.puts "line %s" % i } + } + + obj = Puppet::Type.type(:file).create( + :name => dest, :source => source + ) + + assert_events([:file_created], obj) + + File.open(source, File::APPEND|File::WRONLY) { |f| f.puts "another line" } + + assert_events([:file_changed], obj) + + # Now modify the dest file + File.open(dest, File::APPEND|File::WRONLY) { |f| f.puts "one more line" } + + assert_events([:file_changed, :file_changed], obj) + + end end # $Id$ -- cgit