Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

build_reaper plugin always installed and only deletes builds if confi…

…gured

Build reaper plugin is being loaded before site_config.rb so it was
never being loaded. Now it is always loaded.
  • Loading branch information...
commit b875e88f1b8bcdf18e26086b8d4339647263a0c5 1 parent 6817c41
Jose Capo & Pantera Arzhintar authored
View
4 lib/builder_plugins/build_reaper.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
View
6 test/unit/plugins/build_reaper_test.rb
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.