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

use minitest for windows tests #56

Merged
merged 2 commits into from
Jan 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ namespace :test do
sh('sh', '-c', "cd #{path} && config=test-runner.yaml ruby -I ../../lib docker_test.rb tests/*")
end

task :winrm do
path = File.join(File.dirname(__FILE__), 'test', 'winrm')
sh('sh', '-c', "cd #{path} && ruby windows.rb")
task :windows do
Dir.glob('test/windows/*_test.rb').all? do |file|
sh(Gem.ruby, '-w', '-Ilib:test', file)
end or fail 'Failures'
end

task :vm do
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ build_script:

test_script:
- SET SPEC_OPTS=--format progress
- bundle exec rake test:winrm
- bundle exec rake test:windows
34 changes: 34 additions & 0 deletions test/windows/local_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter

require 'minitest/autorun'
require 'minitest/spec'
require 'mocha/setup'
require 'train'

describe 'windows local command' do
let(:conn) {
# get final config
target_config = Train.target_config({})
# initialize train
backend = Train.create('local', target_config)

# start or reuse a connection
conn = backend.connection
conn
}

it 'verify os' do
os = conn.os
os[:name].must_equal nil
os[:family].must_equal "windows"
os[:release].must_equal "Server 2012 R2"
os[:arch].must_equal nil
end

after do
# close the connection
conn.close
end
end
40 changes: 40 additions & 0 deletions test/windows/winrm_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter

require 'minitest/autorun'
require 'minitest/spec'
require 'mocha/setup'
require 'train'

describe 'windows local command' do
let(:conn) {
# get final config
target_config = Train.target_config({
target: ENV['train_target'],
password: ENV['winrm_pass'],
ssl: ENV['train_ssl'],
self_signed: true,
})

# initialize train
backend = Train.create('winrm', target_config)

# start or reuse a connection
conn = backend.connection
conn
}

it 'verify os' do
os = conn.os
os[:name].must_equal nil
os[:family].must_equal "windows"
os[:release].must_equal "Server 2012 R2"
os[:arch].must_equal nil
end

after do
# close the connection
conn.close
end
end
62 changes: 0 additions & 62 deletions test/winrm/windows.rb

This file was deleted.