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/10/03 23:30:31 UTC

svn commit: r821419 - /buildr/trunk/spec/packaging/archive_spec.rb

Author: boisvert
Date: Sat Oct  3 21:30:30 2009
New Revision: 821419

URL: http://svn.apache.org/viewvc?rev=821419&view=rev
Log:
Use absolute path with File.chmod() to make JRuby happy

Modified:
    buildr/trunk/spec/packaging/archive_spec.rb

Modified: buildr/trunk/spec/packaging/archive_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/packaging/archive_spec.rb?rev=821419&r1=821418&r2=821419&view=diff
==============================================================================
--- buildr/trunk/spec/packaging/archive_spec.rb (original)
+++ buildr/trunk/spec/packaging/archive_spec.rb Sat Oct  3 21:30:30 2009
@@ -377,8 +377,13 @@
   end
 
   it 'should preserve file permissions' do
-    write 'src/main/bin/hello', 'echo hi'
-    chmod 0777,  'src/main/bin/hello'
+    # with JRuby it's important to use absolute paths with File.chmod()
+    # http://jira.codehaus.org/browse/JRUBY-3300
+    hello = File.expand_path('src/main/bin/hello')
+    write hello, 'echo hi'
+    File.chmod(0777,  hello) || 
+    fail("Failed to set permission on #{hello}") unless (File.stat(hello).mode & 0777) == 0777
+
     zip('foo.zip').include('src/main/bin/*').invoke
     unzip('target' => 'foo.zip').extract
     (File.stat('target/hello').mode & 0777).should == 0777