uptimerobot 0.1.1 → 0.1.2

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: 82d5e170641cb08fbf29051fa5773449de3ae206
4
- data.tar.gz: e8b79c5ec5aaab40aed415bb1a6f90b41da7639d
3
+ metadata.gz: 006ec7202822a33f9317f61b64d60b7140ff00f5
4
+ data.tar.gz: 65078bd836e6a1ebf9785bd963393ce69fb9a244
5
5
  SHA512:
6
- metadata.gz: 53a49f3e63dc3fcede29d3d4dc8338bc08ac058f048467826256a7efbfd3bed87171de15f1380dc0936a33837b3ea76edd99e6c712d12cc98370006047a80b21
7
- data.tar.gz: 6edfe1d497d0ae681250379641119aab93d8e37e38d65b7eac66ef65560bc756dc2488d08560f3496418a96487e5d18b5a93f21913127a2ed76f3ec3f9cbffc0
6
+ metadata.gz: da1b503a92834da031af255877d716e145e96206a07814294e09d1c0d40036cb58df31dd5133a4f25cf9782d52e5096c0fe4da398bfdbb43ca95e5af74ae950b
7
+ data.tar.gz: 411656731c19126fe966e0fe3ce0f0fedb34226c67794ac22f8c532225bb4fe422a1f97a737248b9929020b66967881421172975f88f76d1d381cb8a781c0524
data/README.md CHANGED
@@ -43,10 +43,10 @@ client.getMonitors
43
43
  # ...
44
44
 
45
45
  client.newMonitor(
46
- :monitorFriendlyName => 'Google',
47
- :monitorURL => 'http://www.google.com',
48
- :monitorType => UptimeRobot::Monitor::Type::HTTP,
49
- :monitorAlertContacts => '448-716'
46
+ monitorFriendlyName: 'Google',
47
+ monitorURL: 'http://www.google.com',
48
+ monitorType: UptimeRobot::Monitor::Type::HTTP,
49
+ monitorAlertContacts: '448,716'
50
50
  )
51
51
  ```
52
52
 
@@ -21,7 +21,7 @@ class UptimeRobot::Client
21
21
  def initialize(options)
22
22
  @apiKey = options.delete(:apiKey)
23
23
 
24
- raise ':apiKey is required' unless @apiKey
24
+ raise ArgumentError, ':apiKey is required' unless @apiKey
25
25
 
26
26
  options[:url] ||= ENDPOINT
27
27
 
@@ -1,3 +1,3 @@
1
1
  module UptimeRobot
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -6,10 +6,12 @@ DEFAULT_PARAMS = {
6
6
  'noJsonCallback' => '1'
7
7
  }
8
8
 
9
- def uptime_robot
9
+ def uptime_robot(options = {})
10
+ options = {apiKey: 'ZAPZAPZAP'}.merge(options)
11
+
10
12
  stubs = Faraday::Adapter::Test::Stubs.new
11
13
 
12
- described_class.new(apiKey: 'ZAPZAPZAP') do |faraday|
14
+ described_class.new(options) do |faraday|
13
15
  faraday.adapter :test, stubs do |stub|
14
16
  yield(stub)
15
17
  end
@@ -320,4 +320,12 @@ describe UptimeRobot::Client do
320
320
  }.to raise_error(ArgumentError, 'invalid argument: [0]')
321
321
  end
322
322
  end
323
+
324
+ context 'when apiKey is not passed' do
325
+ it do
326
+ expect {
327
+ uptime_robot(:apiKey => nil)
328
+ }.to raise_error(ArgumentError, ':apiKey is required')
329
+ end
330
+ end
323
331
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uptimerobot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-26 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday