You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by to...@apache.org on 2010/06/30 23:37:05 UTC

svn commit: r959445 - in /buildr/trunk: lib/buildr/core/compile.rb spec/java/external_spec.rb

Author: toulmean
Date: Wed Jun 30 21:37:05 2010
New Revision: 959445

URL: http://svn.apache.org/viewvc?rev=959445&view=rev
Log:
fix the compiler manipulations we make in the specs to avoid messing up the whole specs

Modified:
    buildr/trunk/lib/buildr/core/compile.rb
    buildr/trunk/spec/java/external_spec.rb

Modified: buildr/trunk/lib/buildr/core/compile.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/lib/buildr/core/compile.rb?rev=959445&r1=959444&r2=959445&view=diff
==============================================================================
--- buildr/trunk/lib/buildr/core/compile.rb (original)
+++ buildr/trunk/lib/buildr/core/compile.rb Wed Jun 30 21:37:05 2010
@@ -50,7 +50,13 @@ module Buildr
       def compilers
         @compilers ||= []
       end
-
+      
+      private
+      
+      # Only used by our specs.
+      def compilers=(compilers)
+        @compilers = compilers
+      end
     end
 
     # Base class for all compilers, with common functionality.  Extend and over-ride as you see fit

Modified: buildr/trunk/spec/java/external_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/external_spec.rb?rev=959445&r1=959444&r2=959445&view=diff
==============================================================================
--- buildr/trunk/spec/java/external_spec.rb (original)
+++ buildr/trunk/spec/java/external_spec.rb Wed Jun 30 21:37:05 2010
@@ -16,10 +16,14 @@
 
 require File.join(File.dirname(__FILE__), '../spec_helpers')
 
+COMPILERS = Buildr::Compiler.compilers.dup
+COMPILERS_WITHOUT_JAVAC = COMPILERS.dup
+COMPILERS_WITHOUT_JAVAC.delete Buildr::Compiler::Javac
+
 describe Buildr::Compiler::ExternalJavac do
   
-  before :all do
-    Buildr::Compiler.compilers.delete Buildr::Compiler::Javac
+  before(:all) do
+    Buildr::Compiler.send :compilers=, COMPILERS_WITHOUT_JAVAC
   end
   
   describe "should compile a Java project just in the same way javac does" do  
@@ -42,7 +46,7 @@ describe Buildr::Compiler::ExternalJavac
   end
   
   after :all do
-    Buildr::Compiler.compilers.unshift Buildr::Compiler::Javac
+    Buildr::Compiler.send :compilers=, COMPILERS
   end
   
 end