shelly 0.4.36 → 0.4.37
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/shelly/cli/maintenance.rb +4 -0
- data/lib/shelly/version.rb +1 -1
- data/spec/shelly/cli/maintenance_spec.rb +14 -10
- 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: a8cae11e143cf0b16eed1f5fb61648b887b0f549
|
4
|
+
data.tar.gz: 8f652dc1ed1c0dc2b7e94294e3cc4dd4c8155eac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9d71e7c7ffa22775081bbece8f2322d4fd7c831fb3dae334763b68367a4fe4278328fea24546c8a01f53dddd7c6bea496e02e13870c39ff03ba1bf76f6d16da
|
7
|
+
data.tar.gz: f6b3271721e16360b342e123cdcf01bf6c5f015c8064c7338b744a725e48371caa7130b134847ffaa81937c7b0655b7a62d8ba6158e2b1735294ff536b200ab8
|
data/CHANGELOG.md
CHANGED
@@ -46,6 +46,8 @@ module Shelly
|
|
46
46
|
say "Maintenance has been started", :green
|
47
47
|
rescue Client::ValidationException => exception
|
48
48
|
exception.each_error { |error| say_error error, :with_exit => false }
|
49
|
+
rescue Client::ConflictException => e
|
50
|
+
say_error e[:message]
|
49
51
|
end
|
50
52
|
|
51
53
|
desc 'finish', 'Finish last maintenance'
|
@@ -55,6 +57,8 @@ module Shelly
|
|
55
57
|
say "Maintenance has been finished", :green
|
56
58
|
rescue Client::ValidationException => exception
|
57
59
|
exception.each_error { |error| say_error error, :with_exit => false }
|
60
|
+
rescue Client::ConflictException => e
|
61
|
+
say_error e[:message]
|
58
62
|
end
|
59
63
|
end
|
60
64
|
end
|
data/lib/shelly/version.rb
CHANGED
@@ -109,17 +109,19 @@ describe Shelly::CLI::Maintenance do
|
|
109
109
|
context 'because there is another maintenance in progress' do
|
110
110
|
before do
|
111
111
|
body = {
|
112
|
-
'message' => '
|
113
|
-
'errors' => [['base', 'Maintenance already in progress']]
|
112
|
+
'message' => 'Maintenance is already in progress'
|
114
113
|
}
|
115
|
-
exception = Shelly::Client::
|
114
|
+
exception = Shelly::Client::ConflictException.new(body)
|
116
115
|
client.stub(:start_maintenance).and_raise(exception)
|
117
116
|
end
|
118
117
|
|
119
118
|
it 'should print error message' do
|
120
119
|
$stdout.should_receive(:puts).
|
121
|
-
with(red 'Maintenance already in progress')
|
122
|
-
|
120
|
+
with(red 'Maintenance is already in progress')
|
121
|
+
|
122
|
+
lambda {
|
123
|
+
invoke(cli, :start)
|
124
|
+
}.should raise_error(SystemExit)
|
123
125
|
end
|
124
126
|
end
|
125
127
|
end
|
@@ -141,17 +143,19 @@ describe Shelly::CLI::Maintenance do
|
|
141
143
|
context 'because there is no maintenances in progress' do
|
142
144
|
before do
|
143
145
|
body = {
|
144
|
-
'message' => '
|
145
|
-
'errors' => [['base', 'There is no maintenances in progress']]
|
146
|
+
'message' => 'There is no maintenance events in progress'
|
146
147
|
}
|
147
|
-
exception = Shelly::Client::
|
148
|
+
exception = Shelly::Client::ConflictException.new(body)
|
148
149
|
client.stub(:finish_maintenance).and_raise(exception)
|
149
150
|
end
|
150
151
|
|
151
152
|
it 'should print error message' do
|
152
153
|
$stdout.should_receive(:puts).
|
153
|
-
with(red 'There is no
|
154
|
-
|
154
|
+
with(red 'There is no maintenance events in progress')
|
155
|
+
|
156
|
+
lambda {
|
157
|
+
invoke(cli, :finish)
|
158
|
+
}.should raise_error(SystemExit)
|
155
159
|
end
|
156
160
|
end
|
157
161
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shelly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.37
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shelly Cloud team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|