Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardlink spec fix #187

Merged
merged 2 commits into from Oct 21, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions spec/actions/create_link_spec.rb
Expand Up @@ -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
Expand All @@ -34,9 +37,9 @@ 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
end
Expand Down