messagemedia_messages_sdk 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ class TestHelper
15
15
  received_headers,
16
16
  allow_extra: true)
17
17
  return false if ((received_headers.length < expected_headers.length) ||
18
- ((allow_extra == false) && (received_headers.length > expected_headers.length)))
18
+ ((!allow_extra) && (received_headers.length > expected_headers.length)))
19
19
 
20
20
  received_headers = Hash[received_headers.map{|k, v| [k.to_s.downcase, v]}]
21
21
  expected_headers.each do |e_key, e_value|
@@ -40,18 +40,18 @@ class TestHelper
40
40
  check_count: false)
41
41
  if expected_body.instance_of? Hash
42
42
  return false unless received_body.instance_of? Hash
43
- for key in expected_body.keys
43
+ expected_body.keys.each {|key|
44
44
  return false unless received_body.keys.include? key
45
45
  if check_values or expected_body[key].instance_of? Hash
46
- return false unless TestHelper.match_body(expected_body[key],
47
- received_body[key],
48
- check_values: check_values,
49
- check_order: check_order,
46
+ return false unless TestHelper.match_body(expected_body[key],
47
+ received_body[key],
48
+ check_values: check_values,
49
+ check_order: check_order,
50
50
  check_count: check_count)
51
51
  end
52
- end
52
+ }
53
53
  elsif expected_body.instance_of? Array
54
- return False unless received_body.instance_of? Array
54
+ return false unless received_body.instance_of? Array
55
55
  if check_count == true && (expected_body.length != received_body.length)
56
56
  return false
57
57
  else
@@ -65,7 +65,7 @@ class TestHelper
65
65
  check_count: check_count)
66
66
  end).compact
67
67
  return false if matches.length == 0
68
- if check_order == true
68
+ if check_order
69
69
  return false if (i != 0 && matches.map{|x| previous_matches.map{|y| y > x}.all?}.all?)
70
70
  previous_matches = matches
71
71
  end
@@ -75,17 +75,5 @@ class TestHelper
75
75
  return false
76
76
  end
77
77
  return true
78
- end
79
-
80
- # Class method which takes a URL, downloads the file (if not already downloaded
81
- # for this test session) and returns the path of the file.
82
- # @param [String] The URL of the required file.
83
- def self.get_file(url)
84
- unless @cache.keys.include? url
85
- @cache[url] = Tempfile.new('APIMatic')
86
- @cache[url].binmode
87
- @cache[url].write(open(url, {ssl_ca_cert: Certifi.where}).read)
88
- end
89
- return @cache[url].path
90
78
  end
91
79
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messagemedia_messages_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MessageMedia Developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-21 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logging
@@ -116,6 +116,7 @@ files:
116
116
  - lib/message_media_messages/controllers/replies_controller.rb
117
117
  - lib/message_media_messages/exceptions/api_exception.rb
118
118
  - lib/message_media_messages/http/auth/basic_auth.rb
119
+ - lib/message_media_messages/http/auth/hmac_auth.rb
119
120
  - lib/message_media_messages/http/faraday_client.rb
120
121
  - lib/message_media_messages/http/http_call_back.rb
121
122
  - lib/message_media_messages/http/http_client.rb
@@ -161,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
162
  version: '0'
162
163
  requirements: []
163
164
  rubyforge_project:
164
- rubygems_version: 2.6.13
165
+ rubygems_version: 2.5.2
165
166
  signing_key:
166
167
  specification_version: 4
167
168
  summary: MessageMedia Messages SDK