Sha256: 706178f3652131b65494f3c1176b131628b926d898c5e4e6f4d063abaea8acd9

Contents?: true

Size: 1.26 KB

Versions: 1

Compression:

Stored size: 1.26 KB

Contents

require 'spec_helper'

set :os, { :family => nil }

describe 'File related commands'  do
  after do
    property[:os_by_host] = nil
  end

  context get_command(:check_file_is_directory, '/tmp') do
    it { should eq 'test -d /tmp' }
  end

  context get_command(:change_file_mode, '/tmp', '0644') do
    it { should eq 'chmod 0644 /tmp' }
  end

  context get_command(:change_file_owner, '/tmp', 'root') do
    it { should eq 'chown root /tmp' }
  end

  context get_command(:change_file_owner, '/tmp', 'root', 'root') do
    it { should eq 'chown root:root /tmp' }
  end

  context get_command(:change_file_group, '/tmp', 'root') do
    it { should eq 'chgrp root /tmp' }
  end

  context get_command(:create_file_as_directory, '/tmp') do
    it { should eq 'mkdir -p /tmp' }
  end

  context get_command(:get_file_owner_user, '/tmp') do
    it { should eq 'stat -c %U /tmp' }
  end

  context get_command(:get_file_owner_group, '/tmp') do
    it { should eq 'stat -c %G /tmp' }
  end

  context get_command(:move_file, '/src', '/dest') do
    it { should eq 'mv /src /dest' }
  end

  context get_command(:link_file_to, '/link', '/target') do
    it { should eq 'ln -s /target /link' }
  end

  context get_command(:remove_file, '/tmp') do
    it { should eq 'rm -rf /tmp' }
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
specinfra-2.0.0.beta42 spec/command/base/file_spec.rb