You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by vb...@apache.org on 2008/09/05 18:01:40 UTC
svn commit: r692473 - /incubator/buildr/trunk/spec/application_spec.rb
Author: vborja
Date: Fri Sep 5 09:01:39 2008
New Revision: 692473
URL: http://svn.apache.org/viewvc?rev=692473&view=rev
Log:
Get rid of Dir.chdir warning on application_spec.rb
Modified:
incubator/buildr/trunk/spec/application_spec.rb
Modified: incubator/buildr/trunk/spec/application_spec.rb
URL: http://svn.apache.org/viewvc/incubator/buildr/trunk/spec/application_spec.rb?rev=692473&r1=692472&r2=692473&view=diff
==============================================================================
--- incubator/buildr/trunk/spec/application_spec.rb (original)
+++ incubator/buildr/trunk/spec/application_spec.rb Fri Sep 5 09:01:39 2008
@@ -390,9 +390,11 @@
describe Buildr::Application do
+
describe '--project option' do
it 'should change directory before loading buildfile' do
- Dir.chdir('.') do
+ orig_path = Dir.pwd
+ begin
write('buildfile', 'define("invalid") { }')
path = File.expand_path('path/to/project')
write(path+'/buildfile', 'define("valid") { }')
@@ -404,11 +406,14 @@
Buildr::Project.project("valid").path_to(nil).should == path
end
lambda { Buildr.application.run }.should_not raise_error
+ ensure
+ Dir.chdir(orig_path)
end
end
it 'should change to project basedir before executing tasks' do
- Dir.chdir('.') do
+ orig_path = Dir.pwd
+ begin
path = File.expand_path('bar/baz')
mkpath('bar/baz')
write('buildfile', 'define("foo") { define("bar") { define("baz") { } } }')
@@ -418,11 +423,14 @@
Dir.pwd.should == Buildr.application.original_dir
end
lambda { Buildr.application.run }.should_not raise_error
+ ensure
+ Dir.chdir(orig_path)
end
end
it 'should change to project basedir before executing tasks (allow use file_separator for project name)' do
- Dir.chdir('.') do
+ orig_path = Dir.pwd
+ begin
path = File.expand_path('bar/baz')
mkpath('bar/baz')
write('buildfile', 'define("foo") { define("bar") { define("baz") { } } }')
@@ -432,6 +440,8 @@
Dir.pwd.should == Buildr.application.original_dir
end
lambda { Buildr.application.run }.should_not raise_error
+ ensure
+ Dir.chdir(orig_path)
end
end