Permalink
Browse files

Merge pull request #88 from sidereel/master

Fix for build_reaper plugin
  • Loading branch information...
2 parents 6817c41 + b875e88 commit 422b3ee1dc08e7512e3a11dac4324545b413d819 @bguthrie bguthrie committed Jan 19, 2012
Showing with 8 additions and 2 deletions.
  1. +2 −2 lib/builder_plugins/build_reaper.rb
  2. +6 −0 test/unit/plugins/build_reaper_test.rb
@@ -7,7 +7,7 @@ class BuildReaper < BuilderPlugin
cattr_accessor :number_of_builds_to_keep
def build_finished(build)
- delete_all_builds_but BuildReaper.number_of_builds_to_keep
+ delete_all_builds_but BuildReaper.number_of_builds_to_keep unless BuildReaper.number_of_builds_to_keep.nil?
end
def delete_all_builds_but(number)
@@ -17,4 +17,4 @@ def delete_all_builds_but(number)
end
end
-Project.plugin :build_reaper unless BuildReaper.number_of_builds_to_keep.nil?
+Project.plugin :build_reaper
@@ -36,4 +36,10 @@ def test_should_delete_no_builds
assert_equal %w(build-1-success), Dir["*"]
end
+
+ def test_should_only_delete_builds_if_configured
+ @reaper.expects(:delete_all_builds_but).never
+
+ @reaper.build_finished(nil)
+ end
end

0 comments on commit 422b3ee

Please sign in to comment.