Permalink
Browse files

Test for issue #95 - terminating newlines should be preserved when up…

…dating crontab files
  • Loading branch information...
1 parent c4abbef commit d0a7a8600eb02f8103d40eb0a76f112525345c27 @richmeyers richmeyers committed Nov 2, 2010
Showing with 14 additions and 0 deletions.
  1. +14 −0 test/functional/command_line_test.rb
View
14 test/functional/command_line_test.rb
@@ -303,6 +303,20 @@ class CommandLineTest < Test::Unit::TestCase
assert_equal new_cron, @command.send(:prepare, existing)
end
+
+ should "preserve terminating newlines in files" do
+ @command = Whenever::CommandLine.new(:update => true, :identifier => 'My identifier')
+ existing = <<-EXISTING_CRON
+# Begin Whenever generated tasks for: My identifier
+My whenever job that was already here
+# End Whenever generated tasks for: My identifier
+
+# A non-Whenever task
+My non-whenever job that was already here
+EXISTING_CRON
+
+ assert_equal existing, @command.send(:prepare, existing)
+ end
end
end

0 comments on commit d0a7a86

Please sign in to comment.