Author: vborja
Date: Fri Apr 11 08:48:40 2008
New Revision: 647202

URL: http://svn.apache.org/viewvc?rev=647202&view=rev
Log:
Added some failing specs for Generate task

Modified:
    incubator/buildr/trunk/spec/project_spec.rb

Modified: incubator/buildr/trunk/spec/project_spec.rb
URL: 
http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/project_spec.rb?rev=647202&r1=647201&r2=647202&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/project_spec.rb (original)
+++ incubator/buildr/trunk/spec/project_spec.rb Fri Apr 11 08:48:40 2008
@@ -85,7 +85,6 @@
   end
 end
 
-
 describe Project, ' property' do
   it 'should be set if passed as argument' do
     define 'foo', 'version'=>'1.1'
@@ -704,6 +703,23 @@
       file 'bar'=>'baz'
     end
     lambda { project('foo').file('bar').invoke }.should run_tasks(['foo:baz', 
project('foo').path_to('bar')])
+  end
+end
+
+describe Buildr::Generate do 
+  it 'should be able to create buildfile from directory structure' do
+    write 'src/main/java/Foo.java', ''
+    write 'one/two/src/main/java/Foo.java', ''
+    write 'one/three/src/main/java/Foo.java', ''
+    write 'four/src/main/java/Foo.java', ''
+    script = Buildr::Generate.from_directory(Dir.pwd)
+    puts script
+    instance_eval(script.join("\n"), "generated buildfile")
+    # projects should have been defined
+    root = Dir.pwd.pathmap('%n')
+    names = [root, "#{root}:one:two", "#{root}:one:three", "#{root}:four"]
+    # the top level project has the directory name.
+    names.each { |name| lambda { project(name) }.should_not raise_error }
   end
 end
 


Reply via email to