rumour-ruby 0.0.2 → 0.0.3
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/Gemfile +5 -0
- data/lib/rumour-ruby/client.rb +1 -0
- data/lib/rumour-ruby/version.rb +1 -1
- data/spec/client_spec.rb +7 -1
- data/spec/spec_helper.rb +1 -1
- 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: 6fcedf58fc1405166a840214b69cd021061b686c
|
4
|
+
data.tar.gz: c83cf9a0d47872b3fa5d12fb60f0252ef135f362
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b097f87b2d6698b79d126a2b8b8e4ef10abb177adca5f1c5d4d38766311210428da56be8186e6431287fc088dcfacecb86936ad310c66013550568d706a07547
|
7
|
+
data.tar.gz: 4a2ed172d3be58f075b27d2551cdd7b325d0d68aebcf31c8e1bdcd82fe98fdbc9f22ad5444e1abde98d3c8cbbbd0493aaf02bece3130ddf7458d7baaf9ec0361
|
data/Gemfile
CHANGED
data/lib/rumour-ruby/client.rb
CHANGED
@@ -12,6 +12,7 @@ module Rumour
|
|
12
12
|
|
13
13
|
def initialize(access_token = nil)
|
14
14
|
@access_token = access_token || Rumour.configuration.access_token
|
15
|
+
raise Rumour::Errors::AuthenticationError.new('Missing access token') if @access_token.nil?
|
15
16
|
end
|
16
17
|
|
17
18
|
def send_text_message(sender, recipient, body)
|
data/lib/rumour-ruby/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -22,6 +22,12 @@ RSpec.describe Rumour::Client do
|
|
22
22
|
|
23
23
|
expect(rumour_client.access_token).to eq('CONFIGURED_ACCESS_TOKEN')
|
24
24
|
end
|
25
|
+
|
26
|
+
it 'raises an AuthenticationError if no access_token is supplied' do
|
27
|
+
Rumour.configure { |config| config.access_token = nil }
|
28
|
+
expect { rumour_client = Rumour::Client.new }.to raise_error(Rumour::Errors::AuthenticationError)
|
29
|
+
Rumour.configure { |config| config.access_token = 'CONFIGURED_ACCESS_TOKEN' }
|
30
|
+
end
|
25
31
|
end
|
26
32
|
|
27
33
|
describe '.send_text_message with valid data' do
|
@@ -34,7 +40,7 @@ RSpec.describe Rumour::Client do
|
|
34
40
|
end
|
35
41
|
|
36
42
|
describe '.send_text_message with invalid data' do
|
37
|
-
it '
|
43
|
+
it 'raises a RequestError' do
|
38
44
|
rumour_client = Rumour::Client.new(RUMOUR_TEST_ACCESS_TOKEN)
|
39
45
|
|
40
46
|
expect {
|
data/spec/spec_helper.rb
CHANGED