buildr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From boisv...@apache.org
Subject svn commit: r990493 - /buildr/trunk/spec/java/commands_spec.rb
Date Sun, 29 Aug 2010 05:19:56 GMT
Author: boisvert
Date: Sun Aug 29 05:19:55 2010
New Revision: 990493

URL: http://svn.apache.org/viewvc?rev=990493&view=rev
Log:
BUILDR-483: Write specs for java commands (Antoine Toulme)

Modified:
    buildr/trunk/spec/java/commands_spec.rb

Modified: buildr/trunk/spec/java/commands_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/java/commands_spec.rb?rev=990493&r1=990492&r2=990493&view=diff
==============================================================================
--- buildr/trunk/spec/java/commands_spec.rb (original)
+++ buildr/trunk/spec/java/commands_spec.rb Sun Aug 29 05:19:55 2010
@@ -31,4 +31,24 @@ BUILD
     lambda { Java::Commands.java("org.apache.tools.ant.Main", :classpath => Buildr::Ant.dependencies,
:verbose => true) }.should show_info(/java/)
   end
 
+  describe "Java::Commands.javac" do
+
+    it 'should let the user specify an output directory' do
+      write "Foo.java", "public class Foo {}"
+      mkdir_p "classes"
+      lambda { Java::Commands.javac("Foo.java", :output => "classes") }.should change
{File.exist?("classes/Foo.class")}.to(true)
+    end
+
+    it "should let the user specify a different name" do
+      write "Foo.java", "public class Foo {}"
+      lambda { Java::Commands.javac("Foo.java", :name => "bar") }.should show_info("Compiling
1 source files in bar")
+
+    end
+
+    it "should compile java" do
+      write "Foo.java", "public class Foo {}"
+      lambda { Java::Commands.javac("Foo.java") }.should change {File.exist?("Foo.class")}.to(true)
+    end
+  end
+
 end
\ No newline at end of file



Mime
View raw message