cheftest 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7ba61bb722dd8aec2d7152dc058a3f575a0d2167
4
+ data.tar.gz: 27debcacc3e18421aac5586a51e643cfee031c80
5
+ SHA512:
6
+ metadata.gz: be6dce205a57f80c39234f56e2dae032dd10e7b665254eabb9b40fc706806e46f1e00e96b5b622df8542682f2851b501c6b2efc653a67270a5c421833ceef770
7
+ data.tar.gz: cf66126185503868055bed822eb4463797c1751288191f73bb1dfb0c31956eeb46ba6857f5b4e39227ff14a19c2a724aa059dde1a5f948bdb7440c79ebb3bb78
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in cheftest.gemspec
4
+ gemspec
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Dylan Vaughn
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ # ChefTest
2
+
3
+ Provides easy access to several testing tools for Chef cookbooks and related code.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'cheftest'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install cheftest
18
+
19
+ ## Usage
20
+
21
+ cheftest$ rake -T 'ct'
22
+ rake ct # Run all tests
23
+ rake ct:foodcritic # Run foodcritic
24
+ rake ct:knife # Run knife test
25
+ rake ct:spec # Run specs
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
@@ -0,0 +1,5 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ require "cheftest/rake_tasks"
4
+
5
+ ChefTest::RakeTasks.new
@@ -0,0 +1,29 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'cheftest/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "cheftest"
8
+ spec.version = Cheftest::VERSION
9
+ spec.authors = ["Dylan Vaughn"]
10
+ spec.email = ["dylancvaughn@gmail.com"]
11
+ spec.description = %q{Gem providing rake tasks to help with chef cookbook testing}
12
+ spec.summary = %q{Includes: foodcritic, knife test}
13
+ spec.homepage = "https://github.com/dylanvaughn/cheftest"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+
24
+ spec.add_runtime_dependency 'foodcritic'
25
+ spec.add_runtime_dependency 'chef'
26
+ spec.add_runtime_dependency 'rspec'
27
+ spec.add_runtime_dependency 'chefspec'
28
+
29
+ end
@@ -0,0 +1,5 @@
1
+ require "cheftest/version"
2
+
3
+ module Cheftest
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,2 @@
1
+ cache_type 'BasicFile'
2
+ cache_options(:path => "/tmp/chef-knife-test-checksums")
@@ -0,0 +1,3 @@
1
+ require 'cheftest/rake_tasks'
2
+
3
+ ChefTest::RakeTasks.new
@@ -0,0 +1,41 @@
1
+ require 'rake/tasklib'
2
+ require 'rspec/core/rake_task'
3
+
4
+ module ChefTest
5
+ class RakeTasks < ::Rake::TaskLib
6
+
7
+ def initialize
8
+
9
+ desc "Run all tests"
10
+ task "ct" => %w(ct:foodcritic ct:knife ct:spec)
11
+
12
+ desc "Run foodcritic"
13
+ task "ct:foodcritic" do
14
+ sh "bundle exec foodcritic -f any ."
15
+ end
16
+
17
+ desc "Run knife test"
18
+ task "ct:knife" do
19
+ # sh "bundle exec knife cookbook test #{cookbook_directory} -c #{knife_config_file} -o '..'"
20
+ sh "bundle exec knife cookbook test #{cookbook_directory} -o '..'"
21
+ end
22
+
23
+ desc "Run specs"
24
+ RSpec::Core::RakeTask.new("ct:spec") do |t|
25
+ t.rspec_opts = %w(--color)
26
+ end
27
+
28
+ end
29
+
30
+ private
31
+
32
+ def cookbook_directory
33
+ File.basename(Dir.pwd)
34
+ end
35
+
36
+ def knife_config_file
37
+ File.join(File.expand_path(File.dirname(__FILE__)), 'knife.rb')
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,3 @@
1
+ module Cheftest
2
+ VERSION = "0.1.0"
3
+ end
metadata ADDED
@@ -0,0 +1,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cheftest
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Dylan Vaughn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-07-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: foodcritic
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: chef
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: chefspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ description: Gem providing rake tasks to help with chef cookbook testing
98
+ email:
99
+ - dylancvaughn@gmail.com
100
+ executables: []
101
+ extensions: []
102
+ extra_rdoc_files: []
103
+ files:
104
+ - .gitignore
105
+ - Gemfile
106
+ - LICENSE.txt
107
+ - README.md
108
+ - Rakefile
109
+ - cheftest.gemspec
110
+ - lib/cheftest.rb
111
+ - lib/cheftest/knife.rb
112
+ - lib/cheftest/rake.rb
113
+ - lib/cheftest/rake_tasks.rb
114
+ - lib/cheftest/version.rb
115
+ homepage: https://github.com/dylanvaughn/cheftest
116
+ licenses:
117
+ - MIT
118
+ metadata: {}
119
+ post_install_message:
120
+ rdoc_options: []
121
+ require_paths:
122
+ - lib
123
+ required_ruby_version: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - '>='
126
+ - !ruby/object:Gem::Version
127
+ version: '0'
128
+ required_rubygems_version: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - '>='
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ requirements: []
134
+ rubyforge_project:
135
+ rubygems_version: 2.0.3
136
+ signing_key:
137
+ specification_version: 4
138
+ summary: 'Includes: foodcritic, knife test'
139
+ test_files: []