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 +4 -4
- data/lib/chef-dk/command/diff.rb +4 -0
- data/lib/chef-dk/version.rb +1 -1
- data/spec/unit/command/diff_spec.rb +29 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 67e3d7e8d8c597e81964b15ae422a88eb0932d6f
|
4
|
+
data.tar.gz: 304cb60cbec0463d2871ef35b6459fd6847d83ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ea74018cf4e8a23c0bebd202878c760ac9dd4f45051de067e5f349951ab68bf1f27443eb0e81953f43d942f72c57565471719fab8c85f53bf83dea65459adb9
|
7
|
+
data.tar.gz: 5de85053352e6003cac0101ff2648f86b4a32715a2a9539b30be7f7ac1a97786d513e7676820ba37023df9a85cfcc70373419e25d1b33efe4418d2c7da42904d
|
data/lib/chef-dk/command/diff.rb
CHANGED
data/lib/chef-dk/version.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2015-04-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: mixlib-cli
|