Skip to content
Browse files

Hardlink spec fix

This patch fixes "creates a hard link..." example in
spec/actions/create_link_spec.rb so that now it runs on any (sane old-school
;) box where /tmp is mounted from a different partition. Tested particularly
on FreeBSD 8.2
  • Loading branch information...
1 parent c7bbbc9 commit 8d953109eeed809bb30bee1b500b662afca6d133 @argent-smith argent-smith committed Oct 21, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 spec/actions/create_link_spec.rb
View
8 spec/actions/create_link_spec.rb
@@ -4,14 +4,17 @@
describe Thor::Actions::CreateLink do
before(:each) do
+ @hardlink_to = File.join(Dir.tmpdir, 'linkdest.rb')
::FileUtils.rm_rf(destination_root)
+ ::FileUtils.rm_rf(@hardlink_to)
end
def create_link(destination=nil, config={}, options={})
@base = MyCounter.new([1,2], options, { :destination_root => destination_root })
@base.stub!(:file_name).and_return('rdoc')
@tempfile = Tempfile.new("config.rb")
+
@action = Thor::Actions::CreateLink.new(@base, destination, @tempfile.path,
{ :verbose => !@silence }.merge(config))
end
@@ -34,11 +37,12 @@ def silence!
end
it "creates a hard link for :symbolic => false" do
- create_link("doc/config.rb", :symbolic => false)
+ create_link(@hardlink_to, :symbolic => false)
invoke!
- destination_path = File.join(destination_root, "doc/config.rb")
+ destination_path = @hardlink_to
File.exists?(destination_path).should be_true
File.symlink?(destination_path).should be_false
+ ::FileUtils.rm_rf @hardlink_to
end
it "creates a symbolic link by default" do

0 comments on commit 8d95310

Please sign in to comment.
Something went wrong with that request. Please try again.