implement integration tests for ini, csv, json and yaml resources

This commit is contained in:
Christoph Hartmann 2015-11-24 13:07:25 +01:00 committed by Dominik Richter
parent 0531976a40
commit a8e50cd2cf
10 changed files with 72 additions and 0 deletions

View file

@ -0,0 +1,7 @@
name,version,license,title,description
addressable,2.3.6,Apache 2.0,URI Implementation,"Addressable is a replacement for the URI implementation that is part of
Ruby's standard library. It more closely conforms to the relevant RFCs and
adds support for IRIs and URI templates."
ast,2.0.0,MIT,A library for working with Abstract Syntax Trees.,A library for working with Abstract Syntax Trees.
astrolabe,1.3.0,MIT,An object-oriented AST extension for Parser,An object-oriented AST extension for Parser
berkshelf,3.2.3,Apache 2.0,"Manages a Cookbook's, or an Application's, Cookbook dependencies","Manages a Cookbook's, or an Application's, Cookbook dependencies"
1 name version license title description
2 addressable 2.3.6 Apache 2.0 URI Implementation Addressable is a replacement for the URI implementation that is part of Ruby's standard library. It more closely conforms to the relevant RFCs and adds support for IRIs and URI templates.
3 ast 2.0.0 MIT A library for working with Abstract Syntax Trees. A library for working with Abstract Syntax Trees.
4 astrolabe 1.3.0 MIT An object-oriented AST extension for Parser An object-oriented AST extension for Parser
5 berkshelf 3.2.3 Apache 2.0 Manages a Cookbook's, or an Application's, Cookbook dependencies Manages a Cookbook's, or an Application's, Cookbook dependencies

View file

@ -0,0 +1,6 @@
# a comment...
[client]
port = 3306
[mysqld]
user = mysql

View file

@ -0,0 +1,12 @@
{
"name": "demo",
"run_list": [
"apache2",
"omnibus"
],
"cookbook_locks": {
"omnibus": {
"version": "2.2.0"
}
}
}

View file

@ -0,0 +1,7 @@
driver:
name: vagrant
customize:
memory: 1024
platforms:
- name: centos-5.11
- name: centos-6.7

View file

@ -6,6 +6,7 @@
include_recipe('os_prepare::apt')
include_recipe('os_prepare::file')
include_recipe('os_prepare::json_yaml_csv_ini')
include_recipe('os_prepare::package')
include_recipe('os_prepare::registry_key')
include_recipe('os_prepare::service')

View file

@ -0,0 +1,19 @@
# encoding: utf-8
# author: Christoph Hartmann
# author: Dominik Richter
#
# adds a yaml file
gid = 'root'
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
end
}

View file

@ -0,0 +1,5 @@
# encoding: utf-8
describe csv('/tmp/example.csv') do
its('name') { should eq(['addressable', 'ast', 'astrolabe', 'berkshelf']) }
end

View file

@ -0,0 +1,5 @@
# encoding: utf-8
describe ini('/tmp/example.ini') do
its(['client','port']) { should eq('3306') }
end

View file

@ -0,0 +1,5 @@
# encoding: utf-8
describe json('/tmp/example.json') do
its(['cookbook_locks','omnibus','version']) { should eq('2.2.0') }
end

View file

@ -0,0 +1,5 @@
# encoding: utf-8
describe yaml('/tmp/example.yml') do
its(['driver','name']) { should eq('vagrant') }
end