forked from dustymabe/vagrant-sshfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue dustymabe#27 Adding Cucumber tests
- Loading branch information
1 parent
3b81711
commit 2fa2514
Showing
8 changed files
with
102 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# config/cucumber.yml | ||
##YAML Template | ||
--- | ||
default: --profile html | ||
|
||
pretty: --format pretty -b | ||
html: --format progress --format html --out=build/features_report.html -b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Build artifacts | ||
pkg | ||
build | ||
|
||
# Ruby / Bundler | ||
Gemfile.lock | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
require "bundler/gem_tasks" | ||
require 'bundler/gem_tasks' | ||
require 'rake/clean' | ||
require 'cucumber/rake/task' | ||
require 'launchy' | ||
|
||
CLOBBER.include('pkg') | ||
CLEAN.include('build') | ||
|
||
task :init do | ||
FileUtils.mkdir_p 'build' | ||
end | ||
|
||
# Cucumber acceptance test task | ||
Cucumber::Rake::Task.new(:features) | ||
task :features => :init | ||
|
||
namespace :features do | ||
desc 'Opens the HTML Cucumber test report' | ||
task :open_report do | ||
Launchy.open('./build/features_report.html') | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
And(/^user's home directory should be mounted$/) do | ||
run("vagrant ssh -c \"ls #{ENV['HOME']}\"") | ||
expect(last_command_started).to have_exit_status(0) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'aruba/cucumber' | ||
require 'komenda' | ||
|
||
Aruba.configure do |config| | ||
config.exit_timeout = 300 | ||
config.activate_announcer_on_command_failure = [:stdout, :stderr] | ||
config.working_directory = 'build/aruba' | ||
end | ||
|
||
After do |_scenario| | ||
if File.exist?(File.join(aruba.config.working_directory, 'Vagrantfile')) | ||
Komenda.run('bundle exec vagrant destroy -f', cwd: aruba.config.working_directory, fail_on_fail: true) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Feature: Mount of user home directory | ||
|
||
Scenario Outline: Mounting the user's home directory | ||
Given a file named "Vagrantfile" with: | ||
""" | ||
Vagrant.configure('2') do |config| | ||
config.vm.box = '<box>' | ||
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 | ||
end | ||
""" | ||
When I successfully run `bundle exec vagrant up --provider <provider>` | ||
Then stdout from "bundle exec vagrant up --provider <provider>" should contain "Installing SSHFS client..." | ||
And stdout from "bundle exec vagrant up --provider <provider>" should contain "Mounting SSHFS shared folder..." | ||
And stdout from "bundle exec vagrant up --provider <provider>" should contain "Folder Successfully Mounted!" | ||
And user's home directory should be mounted | ||
|
||
Examples: | ||
| box | provider | | ||
| centos/7 | virtualbox | | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters