You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by bo...@apache.org on 2009/11/17 20:31:40 UTC

svn commit: r881453 - in /buildr/trunk: lib/buildr/core/test.rb spec/core/test_spec.rb

Author: boisvert
Date: Tue Nov 17 19:31:34 2009
New Revision: 881453

URL: http://svn.apache.org/viewvc?rev=881453&view=rev
Log:
Add spec for IGNORE_BUILDFILE option

Modified:
    buildr/trunk/lib/buildr/core/test.rb
    buildr/trunk/spec/core/test_spec.rb

Modified: buildr/trunk/lib/buildr/core/test.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/test.rb?rev=881453&r1=881452&r2=881453&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/test.rb (original)
+++ buildr/trunk/lib/buildr/core/test.rb Tue Nov 17 19:31:34 2009
@@ -196,7 +196,10 @@
         @options = OpenObject.new(default_options)
       end
 
-      enhance application.buildfile.prerequisites unless ENV["IGNORE_BUILDFILE"] =~ /(true)|(yes)/i
+      unless ENV["IGNORE_BUILDFILE"] =~ /(true)|(yes)/i
+        enhance [ application.buildfile.name ]
+        enhance application.buildfile.prerequisites
+      end
       enhance do
         run_tests if framework
       end

Modified: buildr/trunk/spec/core/test_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/test_spec.rb?rev=881453&r1=881452&r2=881453&view=diff
==============================================================================
--- buildr/trunk/spec/core/test_spec.rb (original)
+++ buildr/trunk/spec/core/test_spec.rb Tue Nov 17 19:31:34 2009
@@ -684,8 +684,19 @@
     
     it 'should run tests if buildfile changed' do
       touch 'buildfile'
+      test_task.should_receive(:run_tests)
       lambda { test_task.invoke }.should run_task('foo:test')
     end
+
+    it 'should not run tests if buildfile changed but IGNORE_BUILDFILE is true' do
+      begin
+        ENV["IGNORE_BUILDFILE"] = "true"
+        test_task.should_not_receive(:run_tests)
+        test_task.invoke
+      ensure
+        ENV["IGNORE_BUILDFILE"] = nil
+      end
+    end
   end
 end