pagerduty_cli 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pagerduty_cli/common.rb +6 -0
- data/lib/pagerduty_cli/resolve.rb +1 -0
- data/lib/pagerduty_cli/trigger.rb +1 -0
- data/lib/pagerduty_cli/version.rb +1 -1
- data/spec/pagerduty_cli_spec.rb +12 -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: 220d49ae420dba05e82c0470f3347e1e80fac11b
|
4
|
+
data.tar.gz: 50c4e17385bd93995d916faedda383689f10e093
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b94437c151683aa608e2ca42c755a68f6d4738a14f34159a80b179b29f664429341a9a070b9f385428cd9616f84eb380c9e7c8ef48c749ae2e66834733b50dbe
|
7
|
+
data.tar.gz: d72ca04f4baf7c74dcfeee72effbc615d9a245dbe0e9d1a69d8116da67feb8847cc328b33fff352f5fbe445e5e7ccc525c44f3c77629997b16094648ccc2daf3
|
data/lib/pagerduty_cli/common.rb
CHANGED
@@ -57,5 +57,11 @@ module PagerdutyCli
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
# rubocop:enable MethodLength
|
60
|
+
|
61
|
+
# croak if required options are not present
|
62
|
+
def require_event
|
63
|
+
return if @options[:event]
|
64
|
+
croak('Error: event option is required. Run with -h to see usage.')
|
65
|
+
end
|
60
66
|
end
|
61
67
|
end
|
data/spec/pagerduty_cli_spec.rb
CHANGED
@@ -81,6 +81,18 @@ describe PagerdutyCli do
|
|
81
81
|
expect(stub_actor.options[:event]).to eq('foo')
|
82
82
|
end
|
83
83
|
|
84
|
+
it 'returns an error when no event is specified' do
|
85
|
+
args = []
|
86
|
+
stub_actor = StubPagerdutyCliActor.new
|
87
|
+
stub_actor.options[:event] = nil
|
88
|
+
allow($stderr).to receive(:puts)
|
89
|
+
stub_optionparser = OptionParser.new
|
90
|
+
stub_actor.parse_common_options(stub_optionparser)
|
91
|
+
stub_optionparser.parse!(args)
|
92
|
+
expect { stub_actor.require_event }.to raise_error(SystemExit)
|
93
|
+
expect($stderr).to have_received(:puts)
|
94
|
+
end
|
95
|
+
|
84
96
|
it 'prints help and exits with -h' do
|
85
97
|
args = %w(-h)
|
86
98
|
stub_actor = StubPagerdutyCliActor.new
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagerduty_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Dossey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-12-
|
11
|
+
date: 2014-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pagerduty
|