stack_commander 0.0.5 → 0.0.6
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 +4 -4
- data/lib/stack_commander/command.rb +4 -0
- data/lib/stack_commander/version.rb +1 -1
- data/spec/command_spec.rb +16 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea6f033d5e877f5bb3db2ac7eb92a9afbc2c5e37
|
4
|
+
data.tar.gz: 27354acec969c480e1a7e5602050ae6cd68a3657
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df22317821decb2cb30742f8cac7e8011b5fa144a481b5cef85d961a564907dd685934670dc5f01e5ff651eb6ea82aad1a7a40934e9ddb58facac5d9aba42697
|
7
|
+
data.tar.gz: bbce7a98ecef2be964f1c92cff513a9f945c3c9e0f2ec71fdb8eab37e861f1a6fdbdb70ab4cb27c766bdf38fafe19348772dc4bbeca0e2e9db0220451575fe07
|
data/spec/command_spec.rb
CHANGED
@@ -44,23 +44,36 @@ describe StackCommander::Command do
|
|
44
44
|
|
45
45
|
context 'exception is raised' do
|
46
46
|
|
47
|
+
after do
|
48
|
+
expect { subject.call(stack) }.to raise_error(StandardError)
|
49
|
+
end
|
50
|
+
|
47
51
|
before do
|
48
52
|
expect(stack).to receive(:call).and_raise(StandardError)
|
49
53
|
end
|
50
54
|
|
55
|
+
context 'logger exists' do
|
56
|
+
let(:logger) { double('logger') }
|
57
|
+
|
58
|
+
before do
|
59
|
+
allow(subject).to receive(:logger).and_return(logger)
|
60
|
+
end
|
61
|
+
|
62
|
+
it 'logs error' do
|
63
|
+
expect(logger).to receive(:error).with(an_instance_of(StandardError))
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
51
67
|
it 'still calls insurance' do
|
52
68
|
expect(subject).to receive(:insurance)
|
53
|
-
expect { subject.call(stack) }.to raise_error(StandardError)
|
54
69
|
end
|
55
70
|
|
56
71
|
it 'calls recover' do
|
57
72
|
expect(subject).to receive(:recover).with(an_instance_of(StandardError))
|
58
|
-
expect{ subject.call(stack) }.to raise_error(StandardError)
|
59
73
|
end
|
60
74
|
|
61
75
|
it 'does not call cleanup' do
|
62
76
|
expect(subject).not_to receive(:cleanup)
|
63
|
-
expect{ subject.call(stack) }.to raise_error(StandardError)
|
64
77
|
end
|
65
78
|
end
|
66
79
|
end
|