add yml, csv, json and ini to windows integration tests

This commit is contained in:
Christoph Hartmann 2015-12-08 21:42:07 +01:00 committed by Dominik Richter
parent 5df44fef9a
commit b24ed632a1
5 changed files with 41 additions and 10 deletions

View file

@ -9,11 +9,18 @@ gid = 'wheel' if node['platform_family'] == 'freebsd'
['yml', 'json', 'csv', 'ini'].each { |filetype|
cookbook_file "/tmp/example.#{filetype}" do
source "example.#{filetype}"
owner 'root'
group gid
mode '0755'
action :create
if node['platform_family'] != 'windows'
cookbook_file "/tmp/example.#{filetype}" do
source "example.#{filetype}"
owner 'root'
group gid
mode '0755'
action :create
end
else
cookbook_file "C:/windows/temp/example.#{filetype}" do
source "example.#{filetype}"
action :create
end
end
}

View file

@ -1,5 +1,11 @@
# encoding: utf-8
describe csv('/tmp/example.csv') do
if os.unix?
filename = '/tmp/example.csv'
else
filename = 'c:/windows/temp/example.csv'
end
describe csv(filename) do
its('name') { should eq(['addressable', 'ast', 'astrolabe', 'berkshelf']) }
end

View file

@ -1,5 +1,11 @@
# encoding: utf-8
describe ini('/tmp/example.ini') do
if os.unix?
filename = '/tmp/example.ini'
else
filename = 'c:/windows/temp/example.ini'
end
describe ini(filename) do
its(['client','port']) { should eq('3306') }
end

View file

@ -1,5 +1,11 @@
# encoding: utf-8
describe json('/tmp/example.json') do
if os.unix?
filename = '/tmp/example.json'
else
filename = 'c:/windows/temp/example.json'
end
describe json(filename) do
its(['cookbook_locks','omnibus','version']) { should eq('2.2.0') }
end

View file

@ -1,5 +1,11 @@
# encoding: utf-8
describe yaml('/tmp/example.yml') do
if os.unix?
filename = '/tmp/example.yml'
else
filename = 'c:/windows/temp/example.yml'
end
describe yaml(filename) do
its(['driver','name']) { should eq('vagrant') }
end