diff --git a/features/step_definitions/user_home_dir_mount_steps.rb b/features/step_definitions/user_home_dir_mount_steps.rb index ebd92e9..a848352 100644 --- a/features/step_definitions/user_home_dir_mount_steps.rb +++ b/features/step_definitions/user_home_dir_mount_steps.rb @@ -1,4 +1,4 @@ -And(/^user's home directory should be mounted$/) do - run("vagrant ssh -c \"ls #{ENV['HOME']}\"") +And(/^vagrant current working directory should be mounted$/) do + run("vagrant ssh -c 'ls /testdir/Vagrantfile'") expect(last_command_started).to have_exit_status(0) end diff --git a/features/user_home_dir_mount.feature b/features/user_home_dir_mount.feature index 4dc0c9e..6e21260 100644 --- a/features/user_home_dir_mount.feature +++ b/features/user_home_dir_mount.feature @@ -1,28 +1,25 @@ -Feature: Mount of user home directory +Feature: SSHFS mount of vagrant current working directory - Scenario Outline: Mounting the user's home directory + Scenario Outline: SSHFS mounting of vagrant cwd Given a file named "Vagrantfile" with: """ Vagrant.configure('2') do |config| config.vm.box = '' + # Disable the default rsync config.vm.synced_folder '.', '/vagrant', disabled: true - if Vagrant::Util::Platform.windows? - target_path = ENV['USERPROFILE'].gsub(/\\/,'/').gsub(/[[:alpha:]]{1}:/){|s|'/' + s.downcase.sub(':', '')} - config.vm.synced_folder ENV['USERPROFILE'], target_path, type: 'sshfs', sshfs_opts_append: '-o umask=000 -o uid=1000 -o gid=1000' - else - config.vm.synced_folder ENV['HOME'], ENV['HOME'], type: 'sshfs', sshfs_opts_append: '-o umask=000 -o uid=1000 -o gid=1000' - end + # Mount up the current dir. It will have the Vagrantfile in there. + config.vm.synced_folder './', '/testdir', type: 'sshfs' end """ When I successfully run `bundle exec vagrant up` Then stdout from "bundle exec vagrant up" should contain "Installing SSHFS client..." And stdout from "bundle exec vagrant up" should contain "Mounting SSHFS shared folder..." And stdout from "bundle exec vagrant up" should contain "Folder Successfully Mounted!" - And user's home directory should be mounted + And vagrant current working directory should be mounted Examples: | box | | centos/7 | - \ No newline at end of file +