twilio_mock 0.4.4 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf02f41b722ccc8bd6d53f9dedfddb084337ce91
4
- data.tar.gz: c0f896b2f1da4bb85a66e2095f34c2288cd9478c
3
+ metadata.gz: d2aad63f29b353ddd775a53e0e999d1675186a1e
4
+ data.tar.gz: 3abd634806454e4f30dd386276c2b814cba410c9
5
5
  SHA512:
6
- metadata.gz: fecb43cf8aa7ae16518ca664c818185adf5913a167db4409fb450df23e92e758bb172910b4e452dbbda24f2967156ddce12a1ce2a126916d043804c298a33592
7
- data.tar.gz: da1cf867e259c5e6bbe4d5c8a91d5c29f47ac44a9ec7ad3dceaa76b78f58b9bcac02321cdfd6afc579684d0d4dcec107e3d3f532cdecf74396e3e3a48797c604
6
+ metadata.gz: 7c45553167f55cfbab343cdd4422128f22f07a00df0a62d687cfa0955f78001f8def5908c28b7876add022f97b7bfec05af13520d5e8bfd8da371baca1414237
7
+ data.tar.gz: d3f2a7f0dd2e77a1ce670e8e2f4fe7084213c0b7ba8e887e141c51a79cb68ab0932d9ef3642c8011782ec35288c6cb767d5d834f97bfe872e40eae17473d3c41
@@ -1,28 +1,32 @@
1
1
  module TwilioExtensions
2
2
  module AccountContext
3
3
  def available_phone_numbers(country_code=:unset)
4
- TwilioMock::Mocker.new.available_number if TwilioMock::Testing.enabled?
4
+ client = @version.instance_variable_get(:@domain).client
5
+ TwilioMock::Mocker.new(username: client.account_sid, token: client.auth_token).available_number if TwilioMock::Testing.enabled?
5
6
  super(country_code)
6
7
  end
7
8
  end
8
9
 
9
10
  module Messages
10
11
  def create(attrs)
11
- TwilioMock::Mocker.new.create_message(attrs) if TwilioMock::Testing.enabled?
12
+ client = @version.instance_variable_get(:@domain).client
13
+ TwilioMock::Mocker.new(username: client.account_sid, token: client.auth_token).create_message(attrs) if TwilioMock::Testing.enabled?
12
14
  super(attrs)
13
15
  end
14
16
  end
15
17
 
16
18
  module IncomingPhoneNumbers
17
19
  def create(attrs)
18
- TwilioMock::Mocker.new.buy_number(attrs) if TwilioMock::Testing.enabled?
20
+ client = @version.instance_variable_get(:@domain).client
21
+ TwilioMock::Mocker.new(username: client.account_sid, token: client.auth_token).buy_number(attrs) if TwilioMock::Testing.enabled?
19
22
  super(attrs)
20
23
  end
21
24
  end
22
25
 
23
26
  module Lookups
24
27
  def fetch(*)
25
- TwilioMock::LookupMocker.new.lookup(@solution[:phone_number]) if TwilioMock::Testing.enabled?
28
+ client = @version.instance_variable_get(:@domain).client
29
+ TwilioMock::LookupMocker.new(username: client.account_sid, token: client.auth_token).lookup(@solution[:phone_number]) if TwilioMock::Testing.enabled?
26
30
  super
27
31
  end
28
32
  end
@@ -9,9 +9,9 @@ module TwilioMock
9
9
  API_VERSION = '2010-04-01'.freeze
10
10
  HOST = 'api.twilio.com'.freeze
11
11
 
12
- def initialize
13
- @username = Twilio.account_sid
14
- @token = Twilio.auth_token
12
+ def initialize(username: Twilio.account_sid, token: Twilio.auth_token)
13
+ @username = username
14
+ @token = token
15
15
  end
16
16
 
17
17
  def create_message(attrs)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio_mock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maicol Bentancor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-27 00:00:00.000000000 Z
11
+ date: 2018-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: twilio-ruby
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.6.10
88
+ rubygems_version: 2.6.14.1
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: Mock for the twilio gem