# Failure in library/ftools/makedirs\_spec.rb

**URL:** <https://www.ruby-forum.com/t/failure-in-library-ftools-makedirs-spec-rb/158479>\
**Category:** IronRuby\
**Created:** [January 23, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/failure-in-library-ftools-makedirs-spec-rb/158479 "2009-01-23T20:18:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [January 23, 2009, 8:18pm UTC](https://www.ruby-forum.com/t/failure-in-library-ftools-makedirs-spec-rb/158479/1 "2009-01-23T20:18:04Z")

</div>

This test fails the second time I run it. I have to then manually delete  
the makedirs\_test folder that is created. The test tries to do  
system(“rmdir makedirs\_test/second\_dir”), but that fails since “/” is  
used. How come its not failing in Snap? What is a platform-independent  
way of deleting a folder hierarchy?

c:\vsl\Merlin\External\Languages\IronRuby\mspec\rubyspec\library\ftools\>runrspec  
-ruby …/library/ftools/makedirs\_spec.rb

c:\vsl\Merlin\External\Languages\IronRuby\mspec\rubyspec\library\ftools\>pushd  
c:\vsl\Merlin\Main…\External\Languages\IronRuby\mspec

c:\vsl\Merlin\External\Languages\IronRuby\mspec\>c:\vsl\Merlin\Main…\External\Languages\Ruby\ruby-1.8.6\bin\ruby.exe  
mspec\bin\mspec-run -fd --verbose --config default.mspec  
rubyspec/core/…/library/ftools/makedirs\_spec.rb

rubyspec/core/…/library/ftools/makedirs\_spec.rb  
Parameter format not correct - “second\_dir”.  
The directory is not empty.  
F

1. 

File.makedirs creates the dirs from arg FAILED  
Expected true  
to equal false

./rubyspec/core/…/library/ftools/makedirs\_spec.rb:14  
./rubyspec/core/…/library/ftools/makedirs\_spec.rb:2:in `all?’  
./rubyspec/core/…/library/ftools/makedirs\_spec.rb:4  
mspec/bin/mspec-run:8

Finished in 0.082000 seconds

1 file, 1 example, 1 expectation, 1 failure, 0 errors

Thanks,  
Shri

---

<div class="post-metadata">

**Author:** ![Shri\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@Shri\_B](https://www.ruby-forum.com/u/Shri_B)\
**Post date:** [January 23, 2009, 8:47pm UTC](https://www.ruby-forum.com/t/failure-in-library-ftools-makedirs-spec-rb/158479/2 "2009-01-23T20:47:37Z")

</div>

FileUtils.rm\_rf(“target”) is a platform independent way. It is also ok,  
because FileUtils is used by MSpec itself. It doesn’t fail in SNAP  
because SNAP does a tfpt treeclean -delete between each run.

JD

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Shri B.  
Sent: Friday, January 23, 2009 11:15 AM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] Failure in library/ftools/makedirs\_spec.rb

This test fails the second time I run it. I have to then manually delete  
the makedirs\_test folder that is created. The test tries to do  
system(“rmdir makedirs\_test/second\_dir”), but that fails since “/” is  
used. How come its not failing in Snap? What is a platform-independent  
way of deleting a folder hierarchy?

c:\vsl\Merlin\External\Languages\IronRuby\mspec\rubyspec\library\ftools\>runrspec  
-ruby …/library/ftools/makedirs\_spec.rb

c:\vsl\Merlin\External\Languages\IronRuby\mspec\rubyspec\library\ftools\>pushd  
c:\vsl\Merlin\Main..\External\Languages\IronRuby\mspec

c:\vsl\Merlin\External\Languages\IronRuby\mspec\>c:\vsl\Merlin\Main..\External\Languages\Ruby\ruby-1.8.6\bin\ruby.exe  
mspec\bin\mspec-run -fd --verbose --config default.mspec  
rubyspec/core/…/library/ftools/makedirs\_spec.rb

rubyspec/core/…/library/ftools/makedirs\_spec.rb  
Parameter format not correct - “second\_dir”.  
The directory is not empty.  
F

1. 

File.makedirs creates the dirs from arg FAILED  
Expected true  
to equal false

./rubyspec/core/…/library/ftools/makedirs\_spec.rb:14  
./rubyspec/core/…/library/ftools/makedirs\_spec.rb:2:in `all?’  
./rubyspec/core/…/library/ftools/makedirs\_spec.rb:4  
mspec/bin/mspec-run:8

Finished in 0.082000 seconds

1 file, 1 example, 1 expectation, 1 failure, 0 errors

Thanks,  
Shri
