serverspec 0.10.3 → 0.10.4

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: d359e8d4e9b0d68239d0c3a3ffee9f98254d91c8
4
- data.tar.gz: 4b12b546c2b2e348481fcc9a89c9dfca40d49713
3
+ metadata.gz: 2e129075cf8dab2aa89c0d5b0c2995a301c3e032
4
+ data.tar.gz: 410f4266d33bcbb3ac5df1c2ad2162cb5f9c8954
5
5
  SHA512:
6
- metadata.gz: 6b0e43c81e0edff3580386ef2f2681fde7df403b1573a4d5db7907a5b3cd7d80e27c91812fa2471518fa2e9bb68d1e6f561e72793bc742879e19a379acdd18c0
7
- data.tar.gz: d01f69272592f65d492c5fb8fd5e9e5fba6c0ad8b458d30fd7796c7f4a43dd531957207c8a07feb6836296212bdd3326d3a57c5e371b35e154ff4cfc91a32786
6
+ metadata.gz: b62a181c674d1cdb217fb48af4749f1e8bba0c90aefcd21c6639d2a92b9f7ab64574f1dd5fd405ec7b646ffeb2ec21788b55e748e1d3721b69c8e4157b6c4bda
7
+ data.tar.gz: 5c631ed3134c89c3617c96d765c53849ab5d006d5c682a395f82c8b0d708e819b1d7f5df69896b07aac598c4e493205d78d9e25cde1c86d56866f3e5c030d5f0
@@ -1,5 +1,5 @@
1
1
  function FindService
2
2
  {
3
3
  param($name)
4
- Get-WmiObject Win32_Service | Where-Object {$_.serviceName -eq $name -or $_.displayName -eq $name}
4
+ Get-WmiObject Win32_Service | Where-Object {$_.Name -eq $name -or $_.DisplayName -eq $name}
5
5
  }
@@ -1,3 +1,3 @@
1
1
  module Serverspec
2
- VERSION = "0.10.3"
2
+ VERSION = "0.10.4"
3
3
  end
@@ -4,6 +4,10 @@ require 'support/powershell_command_runner'
4
4
  include Serverspec::Helper::Cmd
5
5
  include Serverspec::Helper::Windows
6
6
 
7
+ RSpec.configure do |c|
8
+ c.os = 'Windows'
9
+ end
10
+
7
11
  describe "Cmd" do
8
12
  it_behaves_like "a powershell command runner"
9
13
  end
@@ -4,6 +4,10 @@ require 'support/powershell_command_runner'
4
4
  include Serverspec::Helper::WinRM
5
5
  include Serverspec::Helper::Windows
6
6
 
7
+ RSpec.configure do |c|
8
+ c.os = 'Windows'
9
+ end
10
+
7
11
  describe "WinRM" do
8
12
  it_behaves_like "a powershell command runner"
9
13
  end
data/spec/spec_helper.rb CHANGED
@@ -35,26 +35,19 @@ module Serverspec
35
35
  end
36
36
  end
37
37
  end
38
- [Exec, Ssh].each do |clz|
38
+ [Exec, Ssh, Cmd, WinRM].each do |clz|
39
39
  clz.class_eval do
40
40
  include TestCommandRunner
41
41
  def run_command(cmd)
42
+ if RSpec.configuration.os =~ /Windows/
43
+ cmd = cmd.script
44
+ end
42
45
  cmd = build_command(cmd)
43
46
  cmd = add_pre_command(cmd)
44
47
  do_run cmd
45
48
  end
46
49
  end
47
50
  end
48
- [Cmd, WinRM].each do |clz|
49
- clz.class_eval do
50
- include TestCommandRunner
51
- def run_command(cmd)
52
- cmd = build_command(cmd.script)
53
- cmd = add_pre_command(cmd)
54
- do_run cmd
55
- end
56
- end
57
- end
58
51
  end
59
52
 
60
53
  module Type
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  include Serverspec::Helper::Cmd
4
+ RSpec.configure do |c|
5
+ c.os = 'Windows'
6
+ end
4
7
 
5
8
  describe file('/some/valid/file') do
6
9
  it { should be_file }
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  include Serverspec::Helper::Cmd
4
+ RSpec.configure do |c|
5
+ c.os = 'Windows'
6
+ end
4
7
 
5
8
  describe group('test.group') do
6
9
  it { should exist }
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  include Serverspec::Helper::Cmd
4
+ RSpec.configure do |c|
5
+ c.os = 'Windows'
6
+ end
4
7
 
5
8
  describe port(80) do
6
9
  it { should be_listening }
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ include Serverspec::Helper::Cmd
4
+ RSpec.configure do |c|
5
+ c.os = 'Windows'
6
+ end
7
+
8
+ describe service('Test Service') do
9
+ it { should be_enabled }
10
+ its(:command) { should eq "(FindService -name 'Test Service').StartMode -eq 'Auto'" }
11
+ end
12
+
13
+ describe service('invalid-service') do
14
+ it { should_not be_enabled }
15
+ end
16
+
17
+ describe service('Test Service') do
18
+ it { should be_running }
19
+ its(:command) { should eq "(FindService -name 'Test Service').State -eq 'Running'" }
20
+ end
21
+
22
+ describe service('invalid-daemon') do
23
+ it { should_not be_running }
24
+ end
@@ -1,6 +1,9 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  include Serverspec::Helper::Cmd
4
+ RSpec.configure do |c|
5
+ c.os = 'Windows'
6
+ end
4
7
 
5
8
  describe user('test.user') do
6
9
  it { should exist }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gosuke Miyashita
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-13 00:00:00.000000000 Z
11
+ date: 2013-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -369,6 +369,7 @@ files:
369
369
  - spec/windows/file_spec.rb
370
370
  - spec/windows/group_spec.rb
371
371
  - spec/windows/port_spec.rb
372
+ - spec/windows/service_spec.rb
372
373
  - spec/windows/user_spec.rb
373
374
  homepage: http://serverspec.org/
374
375
  licenses:
@@ -563,4 +564,5 @@ test_files:
563
564
  - spec/windows/file_spec.rb
564
565
  - spec/windows/group_spec.rb
565
566
  - spec/windows/port_spec.rb
567
+ - spec/windows/service_spec.rb
566
568
  - spec/windows/user_spec.rb