kitchen-pester 0.2.3 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f8d0fa3b2bb6ec73f40d26095154d8dafd807d75
4
- data.tar.gz: 2e282ff8777f3b51440d1d0f938f21067ccfef8d
3
+ metadata.gz: 4dddeb9336a48f2b8364c7607c86e207542bd380
4
+ data.tar.gz: 57520a56f46c998d8479238551a27956ff3ec0f5
5
5
  SHA512:
6
- metadata.gz: 8841569e60fc2c692639a5b9ad41b119684b000e3f4cb3cd7e5aa0b06c5a57c406b75fc908ec127d67b1f07612332ad656dd851c8a532128e9de49ddec2c301f
7
- data.tar.gz: 7f11dcc65cfdca72f5756137b5b1dbbd2a4d9ff6ec689cebdc574dafb35dbd6d557d926fa64dd253aa89afb868741d0784b09fd4c5c7d9d0e50eaf03ae967a1d
6
+ metadata.gz: e19683ce4b827519da06bd09affe39c9e4fb3c92c8d4a3cad60d8c6dbadaab66a2bef7152477428b97f496bfee1d25eb6a2a44e077818c87d4a57b098db6a886
7
+ data.tar.gz: 259f79974c57f8d16e292cd2cf37716c384460f66a6ea73af604f5ebe912bf6a57fcfadbe5ef36d88f1bff762c97c26c6c3aff9fb19b19a0c5cbb244c384fff4
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in kitchen-pester.gemspec
4
- gemspec
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kitchen-pester.gemspec
4
+ gemspec
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 Steven Murawski
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
22
-
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Steven Murawski
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md CHANGED
@@ -1,31 +1,31 @@
1
- [![Gem Version](https://badge.fury.io/rb/kitchen-pester.svg)](http://badge.fury.io/rb/kitchen-pester)
2
- # Kitchen::Pester
3
-
4
- Execute [Pester](https://github.com/pester/Pester) tests right from Test-Kitchen, without having to transit the Busser layer.
5
-
6
- ## Usage
7
-
8
- Either
9
- ```
10
- gem install kitchen-pester
11
- ```
12
- or include
13
- ```
14
- gem 'kitchen-pester'
15
- ```
16
- in your Gemfile.
17
-
18
- In your .kitchen.yml include
19
- ```
20
- verifier:
21
- name: pester
22
- ```
23
- This can be a top-level declaration, a per-node declaration, or a per-suite declaration.
24
-
25
- ## Contributing
26
-
27
- 1. Fork it ( https://github.com/[my-github-username]/kitchen-pester/fork )
28
- 2. Create your feature branch (`git checkout -b my-new-feature`)
29
- 3. Commit your changes (`git commit -am 'Add some feature'`)
30
- 4. Push to the branch (`git push origin my-new-feature`)
31
- 5. Create a new Pull Request
1
+ [![Gem Version](https://badge.fury.io/rb/kitchen-pester.svg)](http://badge.fury.io/rb/kitchen-pester)
2
+ # Kitchen::Pester
3
+
4
+ Execute [Pester](https://github.com/pester/Pester) tests right from Test-Kitchen, without having to transit the Busser layer.
5
+
6
+ ## Usage
7
+
8
+ Either
9
+ ```
10
+ gem install kitchen-pester
11
+ ```
12
+ or include
13
+ ```
14
+ gem 'kitchen-pester'
15
+ ```
16
+ in your Gemfile.
17
+
18
+ In your .kitchen.yml include
19
+ ```
20
+ verifier:
21
+ name: pester
22
+ ```
23
+ This can be a top-level declaration, a per-node declaration, or a per-suite declaration.
24
+
25
+ ## Contributing
26
+
27
+ 1. Fork it ( https://github.com/[my-github-username]/kitchen-pester/fork )
28
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
29
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
30
+ 4. Push to the branch (`git push origin my-new-feature`)
31
+ 5. Create a new Pull Request
data/Rakefile CHANGED
@@ -1,2 +1,52 @@
1
+ # -*- encoding: utf-8 -*-
2
+
1
3
  require "bundler/gem_tasks"
2
4
 
5
+ require "rake/testtask"
6
+ Rake::TestTask.new(:unit) do |t|
7
+ t.libs.push "lib"
8
+ t.test_files = FileList["spec/**/*_spec.rb"]
9
+ t.verbose = true
10
+ end
11
+
12
+ desc "Run all test suites"
13
+ task :test => [:unit]
14
+
15
+ desc "Display LOC stats"
16
+ task :stats do
17
+ puts "\n## Production Code Stats"
18
+ sh "countloc -r lib"
19
+ puts "\n## Test Code Stats"
20
+ sh "countloc -r spec"
21
+ end
22
+
23
+ require "finstyle"
24
+ require "rubocop/rake_task"
25
+ RuboCop::RakeTask.new(:style) do |task|
26
+ task.options << "--display-cop-names"
27
+ task.options << "--lint"
28
+ task.options << '--config' << '.rubocop.yml'
29
+ task.patterns = ['lib/**/*.rb']
30
+ end
31
+
32
+ require "cane/rake_task"
33
+ desc "Run cane to check quality metrics"
34
+ Cane::RakeTask.new do |cane|
35
+ cane.canefile = "./.cane"
36
+ end
37
+
38
+ desc "Run all quality tasks"
39
+ task :quality => [:cane, :style, :stats]
40
+
41
+ require "yard"
42
+ YARD::Rake::YardocTask.new
43
+
44
+ desc "Generate gem dependency graph"
45
+ task :viz do
46
+ Bundler.with_clean_env do
47
+ sh "bundle viz --without test development guard " \
48
+ "--requirements --version"
49
+ end
50
+ end
51
+
52
+ task :default => [:test, :quality]
@@ -1,6 +1,7 @@
1
- # coding: utf-8
1
+ # encoding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+
4
5
  require 'kitchen/verifier/pester_version'
5
6
 
6
7
  Gem::Specification.new do |spec|
@@ -10,8 +11,8 @@ Gem::Specification.new do |spec|
10
11
  spec.email = ["steven.murawski@gmail.com"]
11
12
  spec.summary = 'Test-Kitchen verifier for Pester.'
12
13
  spec.description = 'Skip all that Busser stuff and jump right into Pester.'
13
- spec.homepage = "https://github.com/smurawski/kitchen-pester"
14
- spec.license = "MIT"
14
+ spec.homepage = "https://github.com/test-kitchen/kitchen-pester"
15
+ spec.license = "Apache 2"
15
16
 
16
17
  spec.files = `git ls-files -z`.split("\x0")
17
18
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
@@ -20,5 +21,7 @@ Gem::Specification.new do |spec|
20
21
 
21
22
  spec.add_development_dependency "bundler", "~> 1.7"
22
23
  spec.add_development_dependency "rake", "~> 10.0"
24
+ spec.add_development_dependency "pry", "~> 0.10"
25
+
23
26
  spec.add_dependency "test-kitchen", "~> 1.4"
24
27
  end
@@ -29,6 +29,8 @@ module Kitchen
29
29
 
30
30
  plugin_version Kitchen::Verifier::PESTER_VERSION
31
31
 
32
+ default_config :restart_winrm, false
33
+
32
34
  # Creates a new Verifier object using the provided configuration data
33
35
  # which will be merged with any default configuration.
34
36
  #
@@ -69,6 +71,7 @@ module Kitchen
69
71
  return if local_suite_files.empty?
70
72
 
71
73
  cmd = <<-CMD
74
+ set-executionpolicy unrestricted -force
72
75
  if (-not (get-module -list pester)) {
73
76
  if (-not (get-module PsGet)){
74
77
  iex (new-object Net.WebClient).DownloadString('http://bit.ly/GetPsGet')
@@ -87,6 +90,7 @@ module Kitchen
87
90
  #
88
91
  # @return [String] a command string
89
92
  def init_command
93
+ restart_winrm_service if config[:restart_winrm]
90
94
  end
91
95
 
92
96
  # Generates a command string which will perform any commands or
@@ -105,16 +109,24 @@ module Kitchen
105
109
  # @return [String] a command string
106
110
  def run_command
107
111
  return if local_suite_files.empty?
108
-
109
- wrap_shell_code(Util.outdent!(<<-CMD))
112
+ wrap_shell_code(Util.outdent!(<<-CMD
110
113
  cd "#{File.join(config[:root_path],'suites/pester/' )}"
111
114
  $global:ProgressPreference = 'SilentlyContinue'
112
- invoke-pester -enableexit
115
+ import-module Pester -force; invoke-pester -enableexit
113
116
  CMD
117
+ ))
114
118
  end
115
119
 
116
120
  #private
117
121
 
122
+ def restart_winrm_service
123
+ wrap_shell_code(Util.outdent!(<<-CMD
124
+ schtasks /Create /TN restart_winrm /TR "powershell -command restart-service winrm" /SC ONCE /ST 00:00
125
+ schtasks /RUN /TN restart_winrm
126
+ CMD
127
+ ))
128
+ end
129
+
118
130
  # Returns an Array of test suite filenames for the related suite currently
119
131
  # residing on the local workstation. Any special provisioner-specific
120
132
  # directories (such as a Chef roles/ directory) are excluded.
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Verifier
3
- PESTER_VERSION = '0.2.3'
3
+ PESTER_VERSION = '0.3.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-pester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-15 00:00:00.000000000 Z
11
+ date: 2015-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: pry
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.10'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.10'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: test-kitchen
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,9 +80,9 @@ files:
66
80
  - kitchen-pester.gemspec
67
81
  - lib/kitchen/verifier/pester.rb
68
82
  - lib/kitchen/verifier/pester_version.rb
69
- homepage: https://github.com/smurawski/kitchen-pester
83
+ homepage: https://github.com/test-kitchen/kitchen-pester
70
84
  licenses:
71
- - MIT
85
+ - Apache 2
72
86
  metadata: {}
73
87
  post_install_message:
74
88
  rdoc_options: []