chef-dk 0.5.0 → 0.5.1

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: f4c7157bf3d3e4ddd0f51f9250986b3bf63acc43
4
- data.tar.gz: 02544f6eef80b3a956f1adb70b4804a0ff63e548
3
+ metadata.gz: 67e3d7e8d8c597e81964b15ae422a88eb0932d6f
4
+ data.tar.gz: 304cb60cbec0463d2871ef35b6459fd6847d83ee
5
5
  SHA512:
6
- metadata.gz: ad02bbd68abf16906f4d04dfcd2514c606783a391d5d782576e5c0493819fad22a59ea0efdde4c96d12761a9db13df49e69bdf18ada982b8dd2d5540c2d45e2d
7
- data.tar.gz: bf912bf1c52def5d04f34ab29b7d18ddcf2a689679b067e4c9e70f401e5e01db4814eb24e09b96183dd064e98da580b091b23315eb9bf9bb6747f1eaaa955229
6
+ metadata.gz: 4ea74018cf4e8a23c0bebd202878c760ac9dd4f45051de067e5f349951ab68bf1f27443eb0e81953f43d942f72c57565471719fab8c85f53bf83dea65459adb9
7
+ data.tar.gz: 5de85053352e6003cac0101ff2648f86b4a32715a2a9539b30be7f7ac1a97786d513e7676820ba37023df9a85cfcc70373419e25d1b33efe4418d2c7da42904d
@@ -118,6 +118,10 @@ BANNER
118
118
  @new_lock = nil
119
119
  end
120
120
 
121
+ def debug?
122
+ !!config[:debug]
123
+ end
124
+
121
125
  def run(params = [])
122
126
  return 1 unless apply_params!(params)
123
127
  print_diff
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module ChefDK
19
- VERSION = "0.5.0"
19
+ VERSION = "0.5.1"
20
20
  end
@@ -18,6 +18,7 @@
18
18
  require 'spec_helper'
19
19
  require 'shared/command_with_ui_object'
20
20
  require 'chef-dk/command/diff'
21
+ require 'chef-dk/service_exceptions'
21
22
 
22
23
  describe ChefDK::Command::Diff do
23
24
 
@@ -68,6 +69,34 @@ describe ChefDK::Command::Diff do
68
69
 
69
70
  end
70
71
 
72
+ context "when an PolicyfileServiceError is encountered" do
73
+
74
+ let(:params) { %w{ --head } }
75
+
76
+ context "without a reason" do
77
+
78
+ it "prints the exception successfully" do
79
+ expect(command).to receive(:print_diff).and_raise(ChefDK::PolicyfileServiceError)
80
+ expect(command.run(params)).to eq(1)
81
+ expect(ui.output).to include("Error: ChefDK::PolicyfileServiceError")
82
+ end
83
+
84
+ end
85
+
86
+ context "with a reason" do
87
+
88
+ let(:err) { ChefDK::PolicyfileNestedException.new("msg", RuntimeError.new) }
89
+
90
+ it "prints the exception and reason successfully" do
91
+ expect(command).to receive(:print_diff).and_raise(err)
92
+ expect(command.run(params)).to eq(1)
93
+ expect(ui.output).to include("Error: msg\nReason: (RuntimeError) RuntimeError")
94
+ end
95
+
96
+ end
97
+
98
+ end
99
+
71
100
  context "when server and git comparison bases are mixed" do
72
101
 
73
102
  let(:params) { %w{ --git gitref policygroup } }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-dk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel DeLeo
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-04-29 00:00:00.000000000 Z
13
+ date: 2015-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: mixlib-cli