chef-handler-status_notifier 0.0.2 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: af9799c0260c5573bee0ed6838f7e6cca470c1a9
4
- data.tar.gz: 701b925e7f0506e484602537c77d097f28af93a6
3
+ metadata.gz: 25b94d5fb43b033b90f22b3172eea91b5c6a355e
4
+ data.tar.gz: 1ad7aa9146a72435bcf24e7d1ca99386138b8449
5
5
  SHA512:
6
- metadata.gz: 1e9b3744b1bc2ce85d0107cbb1f5b61156ff555a462e4fee09258e2506aa7e1498d77c36fd3e5e34139abb17c74e1db88c544a6f32177e36eb262f3178874bb3
7
- data.tar.gz: 66b6ba954166675fd72c07e8f7ea2efde7e246437e60e769a5cc6b127bdedc6acece588b9ee11de842aa1191cd6a9caf1c8c9b4e57f3bef1c9a499619ce5ea56
6
+ metadata.gz: d6fc054b86f2cd59f33e7403e46ffb7da65dc45c576a787a9b4d55c338249c718b5a50e6261d7dce327fa3b9ba668a2698db5231904f23c7c67f2fa71c926751
7
+ data.tar.gz: 3d370da722ce30f628fce809b6e75f37d06524322859fce88274b22101720cb8f965a91ed3f066f67b00e51bfc345dfb77ea370951aeb2de2899eb36dcab942a
data/.rspec ADDED
@@ -0,0 +1,4 @@
1
+ --color
2
+ --format progress
3
+ --backtrace
4
+ --pattern spec/**/*_spec.rb
@@ -1,10 +1,9 @@
1
1
  lib = File.expand_path('../lib', __FILE__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'chef/handler/status_notifier/version'
4
3
 
5
4
  Gem::Specification.new do |spec|
6
5
  spec.name = "chef-handler-status_notifier"
7
- spec.version = Chef::Handler::StatusNotifier::VERSION
6
+ spec.version = "0.3.0"
8
7
  spec.authors = ["Faizal Zakaria"]
9
8
  spec.email = ["phaibusiness@gmail.com"]
10
9
  spec.summary = %q{Chef status notifier handler}
@@ -18,4 +17,5 @@ Gem::Specification.new do |spec|
18
17
  spec.require_paths = ["lib"]
19
18
  spec.add_runtime_dependency "hipchat"
20
19
  spec.add_runtime_dependency "slack-notifier"
20
+ spec.add_development_dependency "rspec"
21
21
  end
@@ -1,6 +1,9 @@
1
1
  require 'rubygems'
2
- require 'chef/handler'
3
- require 'chef'
2
+
3
+ unless ENV['RSPEC']
4
+ require 'chef'
5
+ require 'chef/handler'
6
+ end
4
7
  require 'hipchat'
5
8
  require 'slack-notifier'
6
9
 
data/spec/chef.rb ADDED
@@ -0,0 +1,2 @@
1
+ class Chef
2
+ end
@@ -0,0 +1,25 @@
1
+ class Chef::Handler
2
+ class RunStatus
3
+ def failed?
4
+ true
5
+ end
6
+
7
+ def formatted_exception
8
+ "formatted exception"
9
+ end
10
+ end
11
+
12
+ class Node
13
+ def name
14
+ "node"
15
+ end
16
+ end
17
+
18
+ def run_status
19
+ @run_status ||= RunStatus.new
20
+ end
21
+
22
+ def node
23
+ @node ||= Node.new
24
+ end
25
+ end
@@ -0,0 +1,4 @@
1
+ require 'bundler/setup'
2
+ require_relative 'chef'
3
+ require_relative 'chef/handler'
4
+ require_relative '../lib/chef/handler/status_notifier'
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe StatusNotifierHandler do
4
+
5
+ let(:slack_params) do
6
+ {
7
+ enabled: true,
8
+ webhook_url: "https://slacktest.com",
9
+ channel: "#test",
10
+ username: "FaiNow-Test"
11
+ }
12
+ end
13
+
14
+ let(:hipchat_params) do
15
+ {
16
+ enabled: true
17
+ }
18
+ end
19
+
20
+ it 'should run without error' do
21
+ allow_any_instance_of(StatusNotifierHandler).to receive(:send_to_slack).and_return(true)
22
+ allow_any_instance_of(StatusNotifierHandler).to receive(:send_to_hipchat).and_return(true)
23
+ expect{StatusNotifierHandler.new(slack_params, hipchat_params).report}.to_not raise_error
24
+ end
25
+
26
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-handler-status_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Faizal Zakaria
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-29 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hipchat
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: Chef status notifier handler
42
56
  email:
43
57
  - phaibusiness@gmail.com
@@ -46,13 +60,17 @@ extensions: []
46
60
  extra_rdoc_files: []
47
61
  files:
48
62
  - ".gitignore"
63
+ - ".rspec"
49
64
  - Gemfile
50
65
  - LICENSE.txt
51
66
  - README.md
52
67
  - Rakefile
53
68
  - chef-handler-status_notifier.gemspec
54
69
  - lib/chef/handler/status_notifier.rb
55
- - lib/chef/handler/status_notifier/version.rb
70
+ - spec/chef.rb
71
+ - spec/chef/handler.rb
72
+ - spec/spec_helper.rb
73
+ - spec/status_notifier_spec.rb
56
74
  homepage: ''
57
75
  licenses:
58
76
  - MIT
@@ -73,8 +91,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
91
  version: '0'
74
92
  requirements: []
75
93
  rubyforge_project:
76
- rubygems_version: 2.4.2
94
+ rubygems_version: 2.4.7
77
95
  signing_key:
78
96
  specification_version: 4
79
97
  summary: Chef status notifier handler
80
- test_files: []
98
+ test_files:
99
+ - spec/chef.rb
100
+ - spec/chef/handler.rb
101
+ - spec/spec_helper.rb
102
+ - spec/status_notifier_spec.rb
@@ -1,7 +0,0 @@
1
- module Chef
2
- module Handler
3
- module StatusNotifier
4
- VERSION = "0.0.2"
5
- end
6
- end
7
- end