inteltech_sms 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.coveralls.yml +1 -0
- data/.travis.yml +63 -27
- data/Gemfile +4 -3
- data/README.rdoc +6 -1
- data/VERSION +1 -1
- data/inteltech_sms.gemspec +16 -14
- data/lib/inteltech_sms.rb +5 -0
- data/test/helper.rb +4 -0
- data/test/test_inteltech_sms.rb +65 -31
- metadata +121 -112
- data/.ruby-version +0 -1
- data/Gemfile.lock +0 -73
data/.coveralls.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
service_name: travis-ci
|
data/.travis.yml
CHANGED
@@ -1,32 +1,68 @@
|
|
1
|
-
---
|
2
|
-
notifications:
|
3
|
-
email:
|
1
|
+
---
|
2
|
+
notifications:
|
3
|
+
email:
|
4
4
|
on_failure: always
|
5
5
|
on_success: change
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
6
|
+
|
7
|
+
before_install:
|
8
|
+
- gem update --system $RUBYGEMS_VERSION
|
9
|
+
- gem --version
|
10
|
+
- gem install bundler
|
11
|
+
- bundle --version
|
12
|
+
|
13
|
+
before_script:
|
14
|
+
- bundle exec rake install
|
15
|
+
|
13
16
|
language: ruby
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
- gem install bundler
|
18
|
-
- bundle --version
|
19
|
-
env:
|
20
|
-
global:
|
17
|
+
|
18
|
+
env:
|
19
|
+
global:
|
21
20
|
- TEST_GEM=true
|
21
|
+
- RUBYGEMS_VERSION=
|
22
22
|
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
23
|
-
|
24
|
-
|
25
|
-
- 1.
|
26
|
-
-
|
27
|
-
-
|
28
|
-
-
|
29
|
-
- jruby-19mode
|
30
|
-
-
|
31
|
-
|
32
|
-
|
23
|
+
|
24
|
+
rvm:
|
25
|
+
- 1.8.7
|
26
|
+
- 1.9.3
|
27
|
+
- 2.0.0
|
28
|
+
- rbx-19mode
|
29
|
+
- jruby-19mode
|
30
|
+
- ree
|
31
|
+
|
32
|
+
matrix:
|
33
|
+
exclude:
|
34
|
+
- rvm: 1.8.7
|
35
|
+
env: RUBYGEMS_VERSION=
|
36
|
+
- rvm: jruby-19mode
|
37
|
+
env: RUBYGEMS_VERSION=
|
38
|
+
include:
|
39
|
+
- rvm: 1.8.7
|
40
|
+
env:
|
41
|
+
- RUBYGEMS_VERSION=1.8.25
|
42
|
+
- TEST_GEM=true
|
43
|
+
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
44
|
+
- rvm: 1.9.3
|
45
|
+
env:
|
46
|
+
- RUBYGEMS_VERSION=1.8.25
|
47
|
+
- TEST_GEM=true
|
48
|
+
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
49
|
+
- rvm: 2.0.0
|
50
|
+
env:
|
51
|
+
- RUBYGEMS_VERSION=1.8.25
|
52
|
+
- TEST_GEM=true
|
53
|
+
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
54
|
+
- rvm: jruby-19mode
|
55
|
+
env:
|
56
|
+
- RUBYGEMS_VERSION=1.8.25
|
57
|
+
- TEST_GEM=true
|
58
|
+
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
59
|
+
- rvm: rbx-19mode
|
60
|
+
env:
|
61
|
+
- RUBYGEMS_VERSION=1.8.25
|
62
|
+
- TEST_GEM=true
|
63
|
+
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
64
|
+
- rvm: ree
|
65
|
+
env:
|
66
|
+
- RUBYGEMS_VERSION=1.8.25
|
67
|
+
- TEST_GEM=true
|
68
|
+
- secure: "D6Sd+bPmNb3P+98W1arc+SbaFV8oC+0NhnZX9fcoIqCHfnVpt6Vd54idUxJv\nhhFUFmySl17zCX/HRaVoscpCYPcJWRWIeXSD4qrHlObaTx+BDKlMAlWl/Y7d\nQy9c4g+QbDhz94l3DeNW7VbCYz/YYyRPBCcZK+K3H1KPmMtngRU="
|
data/Gemfile
CHANGED
@@ -6,12 +6,13 @@ source "http://rubygems.org"
|
|
6
6
|
# Add dependencies to develop your gem here.
|
7
7
|
# Include everything needed to run rake, tests, features, etc.
|
8
8
|
group :development do
|
9
|
-
gem "rdoc", "
|
10
|
-
gem "bundler", "
|
11
|
-
gem "jeweler", "
|
9
|
+
gem "rdoc", ">= 3.12"
|
10
|
+
gem "bundler", ">= 1.2.3"
|
11
|
+
gem "jeweler", ">= 1.8.4"
|
12
12
|
gem "travis", ">= 0"
|
13
13
|
gem "travis-lint", ">= 0"
|
14
14
|
gem 'shoulda-context', '>= 0'
|
15
|
+
gem 'coveralls', :require => false
|
15
16
|
end
|
16
17
|
|
17
18
|
group :test do
|
data/README.rdoc
CHANGED
@@ -72,7 +72,8 @@ These are passed to the send_sms and send_multiple_sms methods via an optional h
|
|
72
72
|
|
73
73
|
== Continuous integration tests
|
74
74
|
|
75
|
-
Travis CI testing result: {<img src="https://travis-ci.org/ianheggie/inteltech_sms.png" />}[https://travis-ci.org/ianheggie/inteltech_sms]
|
75
|
+
* Travis CI testing result: {<img src="https://travis-ci.org/ianheggie/inteltech_sms.png" />}[https://travis-ci.org/ianheggie/inteltech_sms]
|
76
|
+
* Code Coverage: {<img src="https://coveralls.io/repos/ianheggie/inteltech_sms/badge.png" alt="Coverage Status" />}[https://coveralls.io/r/ianheggie/inteltech_sms]
|
76
77
|
|
77
78
|
== Contributing to inteltech_sms
|
78
79
|
|
@@ -88,6 +89,10 @@ Travis CI testing result: {<img src="https://travis-ci.org/ianheggie/inteltech_s
|
|
88
89
|
|
89
90
|
Copyright (c) 2013 Ian Heggie. See LICENSE.txt for further details.
|
90
91
|
|
92
|
+
=== Known issues
|
93
|
+
|
94
|
+
* The SMS Gateway no longer responds with 2015 Bad number when a mobile number is not connected. The gateway accepts the request and charges for it, then posts the failure in the history log. (Tested using numbers reserved for fictitious use in films and books etc - tests are now disabled)
|
95
|
+
|
91
96
|
=== Main Contributors
|
92
97
|
|
93
98
|
* Ian Heggie - Developer - Heggie Enterprises Pty Ltd - Contributed development of tests and packaging as gem
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/inteltech_sms.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "inteltech_sms"
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.4"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ian Heggie"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-10-29"
|
13
13
|
s.description = "Ruby gem that provides an InteltechSms class to check credit and send SMS text messages to single or multiple recipients"
|
14
14
|
s.email = "ian@heggie.biz"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,12 +17,11 @@ Gem::Specification.new do |s|
|
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
+
".coveralls.yml",
|
20
21
|
".document",
|
21
22
|
".rbenv-gemsets",
|
22
|
-
".ruby-version",
|
23
23
|
".travis.yml",
|
24
24
|
"Gemfile",
|
25
|
-
"Gemfile.lock",
|
26
25
|
"LICENSE.txt",
|
27
26
|
"README.rdoc",
|
28
27
|
"Rakefile",
|
@@ -35,34 +34,37 @@ Gem::Specification.new do |s|
|
|
35
34
|
s.homepage = "http://github.com/ianheggie/inteltech_sms"
|
36
35
|
s.licenses = ["MIT"]
|
37
36
|
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = "1.8.
|
37
|
+
s.rubygems_version = "1.8.23"
|
39
38
|
s.summary = "Ruby Gem to send SMS via inteltech.com.au"
|
40
39
|
|
41
40
|
if s.respond_to? :specification_version then
|
42
41
|
s.specification_version = 3
|
43
42
|
|
44
43
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
-
s.add_development_dependency(%q<rdoc>, ["
|
46
|
-
s.add_development_dependency(%q<bundler>, ["
|
47
|
-
s.add_development_dependency(%q<jeweler>, ["
|
44
|
+
s.add_development_dependency(%q<rdoc>, [">= 3.12"])
|
45
|
+
s.add_development_dependency(%q<bundler>, [">= 1.2.3"])
|
46
|
+
s.add_development_dependency(%q<jeweler>, [">= 1.8.4"])
|
48
47
|
s.add_development_dependency(%q<travis>, [">= 0"])
|
49
48
|
s.add_development_dependency(%q<travis-lint>, [">= 0"])
|
50
49
|
s.add_development_dependency(%q<shoulda-context>, [">= 0"])
|
50
|
+
s.add_development_dependency(%q<coveralls>, [">= 0"])
|
51
51
|
else
|
52
|
-
s.add_dependency(%q<rdoc>, ["
|
53
|
-
s.add_dependency(%q<bundler>, ["
|
54
|
-
s.add_dependency(%q<jeweler>, ["
|
52
|
+
s.add_dependency(%q<rdoc>, [">= 3.12"])
|
53
|
+
s.add_dependency(%q<bundler>, [">= 1.2.3"])
|
54
|
+
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
55
55
|
s.add_dependency(%q<travis>, [">= 0"])
|
56
56
|
s.add_dependency(%q<travis-lint>, [">= 0"])
|
57
57
|
s.add_dependency(%q<shoulda-context>, [">= 0"])
|
58
|
+
s.add_dependency(%q<coveralls>, [">= 0"])
|
58
59
|
end
|
59
60
|
else
|
60
|
-
s.add_dependency(%q<rdoc>, ["
|
61
|
-
s.add_dependency(%q<bundler>, ["
|
62
|
-
s.add_dependency(%q<jeweler>, ["
|
61
|
+
s.add_dependency(%q<rdoc>, [">= 3.12"])
|
62
|
+
s.add_dependency(%q<bundler>, [">= 1.2.3"])
|
63
|
+
s.add_dependency(%q<jeweler>, [">= 1.8.4"])
|
63
64
|
s.add_dependency(%q<travis>, [">= 0"])
|
64
65
|
s.add_dependency(%q<travis-lint>, [">= 0"])
|
65
66
|
s.add_dependency(%q<shoulda-context>, [">= 0"])
|
67
|
+
s.add_dependency(%q<coveralls>, [">= 0"])
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
data/lib/inteltech_sms.rb
CHANGED
@@ -28,6 +28,8 @@ class InteltechSms
|
|
28
28
|
Unauthorized.new(sms, response_code)
|
29
29
|
when '2015'
|
30
30
|
BadRequest.new(sms, response_code)
|
31
|
+
when '2016'
|
32
|
+
Duplicate.new(sms, response_code)
|
31
33
|
when '2018'
|
32
34
|
NoCredit.new(sms, response_code)
|
33
35
|
when '2022'
|
@@ -70,6 +72,9 @@ class InteltechSms
|
|
70
72
|
class NoCredit < Failure
|
71
73
|
end
|
72
74
|
|
75
|
+
class Duplicate < Failure
|
76
|
+
end
|
77
|
+
|
73
78
|
# class InteltechSms
|
74
79
|
|
75
80
|
|
data/test/helper.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
require 'rubygems'
|
2
|
+
require 'coveralls'
|
3
|
+
Coveralls.wear!
|
4
|
+
|
2
5
|
require 'bundler'
|
3
6
|
begin
|
4
7
|
Bundler.setup(:default, :development)
|
@@ -7,6 +10,7 @@ rescue Bundler::BundlerError => e
|
|
7
10
|
$stderr.puts "Run `bundle install` to install missing gems"
|
8
11
|
exit e.status_code
|
9
12
|
end
|
13
|
+
|
10
14
|
require 'test/unit'
|
11
15
|
require 'shoulda-context'
|
12
16
|
|
data/test/test_inteltech_sms.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'helper'
|
2
|
+
require 'net/http'
|
2
3
|
|
3
4
|
class TestInteltechSms < Test::Unit::TestCase
|
4
5
|
|
@@ -12,10 +13,15 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
12
13
|
|
13
14
|
TEST_SMS = '0411111111'
|
14
15
|
TEST_SMS2 = '+8611111111111'
|
15
|
-
|
16
|
+
# http://www.acma.gov.au/Citizen/Consumer-info/All-about-numbers/Special-numbers/fictitious-numbers-for-radio-film-and-television-i-acma
|
17
|
+
BAD_SMS = '0491570156'
|
16
18
|
|
17
19
|
LANDLINE_SMS = '0862252608' # InteltechSms's landline
|
18
20
|
|
21
|
+
UNIQUE_STRING = ' test#' << ENV['TRAVIS_JOB_NUMBER'].to_s << '-' << (0..2).to_a.map{|a| rand(36**4).to_s(36)}.join('.')
|
22
|
+
|
23
|
+
puts "Tests will contain text ending in #{UNIQUE_STRING}"
|
24
|
+
|
19
25
|
if ENV['SMS_USERNAME'].to_s.empty? or ENV['SMS_KEY'].to_s.empty?
|
20
26
|
puts "Tests for non error conditions are disabled (missing SMS_USERNAME and SMS_KEY values for a valid account)"
|
21
27
|
else
|
@@ -48,7 +54,7 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
48
54
|
|
49
55
|
should "send a single test sms via send_sms" do
|
50
56
|
expected = InteltechSms::Success.new(TEST_SMS, "0000")
|
51
|
-
assert_equal expected, @good_gateway.send_sms(TEST_SMS,'Test from Ruby')
|
57
|
+
assert_equal expected, @good_gateway.send_sms(TEST_SMS,'Test from Ruby - send a single test sms via send_sms' << UNIQUE_STRING)
|
52
58
|
end
|
53
59
|
|
54
60
|
if defined? @@mobile_number
|
@@ -61,18 +67,23 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
61
67
|
end
|
62
68
|
|
63
69
|
context "#send_multiple_sms" do
|
64
|
-
setup do
|
65
|
-
@good_gateway = InteltechSms.new(@@username, @@secure_key)
|
66
|
-
@res = @good_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2],'Test from Ruby'
|
67
|
-
end
|
68
|
-
|
69
70
|
should "return an array with a response for each sms sent" do
|
71
|
+
@good_gateway = InteltechSms.new(@@username, @@secure_key)
|
72
|
+
@res = @good_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2],'Test from Ruby - return an array with a response for each sms sent' << UNIQUE_STRING
|
70
73
|
assert_kind_of Array, @res
|
71
74
|
assert_equal 2, @res.length
|
72
75
|
assert_equal InteltechSms::Success.new(TEST_SMS, "0000"), @res[0], "send_multiple_sms returns success for 1st element"
|
73
76
|
assert_equal InteltechSms::Success.new(TEST_SMS2, "0000"), @res[1], "send_multiple_sms returns success for 2nd element"
|
74
77
|
end
|
75
78
|
|
79
|
+
should "return an array with a response for each sms sent where a comma seperated string is provided" do
|
80
|
+
@good_gateway = InteltechSms.new(@@username, @@secure_key)
|
81
|
+
@res = @good_gateway.send_multiple_sms [TEST_SMS2, TEST_SMS].join(','),'Test from Ruby - return an array with a response for each sms sent where a comma seperated string is provided' << UNIQUE_STRING
|
82
|
+
assert_kind_of Array, @res
|
83
|
+
assert_equal 2, @res.length
|
84
|
+
assert_equal InteltechSms::Success.new(TEST_SMS2, "0000"), @res[0], "send_multiple_sms returns success for 1st element"
|
85
|
+
assert_equal InteltechSms::Success.new(TEST_SMS, "0000"), @res[1], "send_multiple_sms returns success for 2nd element"
|
86
|
+
end
|
76
87
|
end
|
77
88
|
end
|
78
89
|
|
@@ -93,13 +104,13 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
93
104
|
|
94
105
|
should "raise an Unauthorized Error exception when send_sms is called" do
|
95
106
|
ex = assert_raises InteltechSms::Error do
|
96
|
-
@bad_gateway.send_sms TEST_SMS, '
|
107
|
+
@bad_gateway.send_sms TEST_SMS, 'Tests from ruby - with blank username raise an Unauthorized Error exception when send_sms is called' << UNIQUE_STRING
|
97
108
|
end
|
98
109
|
assert_equal InteltechSms::Unauthorized.new(TEST_SMS, "2006"), ex.response
|
99
110
|
end
|
100
111
|
|
101
112
|
should "return an array Unauthorized responses when send_multiple_sms is called" do
|
102
|
-
@res = @bad_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby'
|
113
|
+
@res = @bad_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby - with blank username return an array Unauthorized responses when send_multiple_sms is called' << UNIQUE_STRING
|
103
114
|
assert_kind_of Array, @res
|
104
115
|
assert_equal 2, @res.length, "send_multiple_sms returns results for each sms sent"
|
105
116
|
assert_kind_of InteltechSms::Unauthorized, @res[0], "send_multiple_sms returns Unauthorized for 1st element"
|
@@ -113,29 +124,52 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
113
124
|
# --------------------------------------------------
|
114
125
|
# Code 2015 The destination mobile number is invalid.
|
115
126
|
|
127
|
+
# if defined? @@username
|
128
|
+
# context "with a bad sms number" do
|
129
|
+
# setup do
|
130
|
+
# @good_gateway = InteltechSms.new(@@username, @@secure_key)
|
131
|
+
# end
|
132
|
+
#
|
133
|
+
# should "raise a BadRequest Error exception when send_sms is called" do
|
134
|
+
# ex = assert_raises InteltechSms::Error do
|
135
|
+
# @good_gateway.send_sms BAD_SMS, 'Test from ruby - bad sms number' << UNIQUE_STRING
|
136
|
+
# end
|
137
|
+
# assert_equal InteltechSms::BadRequest.new(BAD_SMS, "2015"), ex.response
|
138
|
+
# end
|
139
|
+
#
|
140
|
+
# should "return an array with BadRequest responses when send_multiple_sms is called with some bad numbers" do
|
141
|
+
# @res = @good_gateway.send_multiple_sms [BAD_SMS, TEST_SMS, LANDLINE_SMS], 'Test from Ruby - return an array with BadRequest responses when send_multiple_sms is called with some bad numbers' << UNIQUE_STRING
|
142
|
+
# assert_kind_of Array, @res
|
143
|
+
# assert_equal 3, @res.length, "send_multiple_sms returns results for each sms sent"
|
144
|
+
# assert_kind_of InteltechSms::BadRequest, @res[0], "send_multiple_sms returns BadRequest for 1st element"
|
145
|
+
# assert_equal InteltechSms::BadRequest.new(BAD_SMS, "2015"), @res[0]
|
146
|
+
# assert_kind_of InteltechSms::Success, @res[1], "send_multiple_sms returns Success for 2nd element"
|
147
|
+
# assert_equal InteltechSms::Success.new(TEST_SMS, "0000"), @res[1]
|
148
|
+
# assert_kind_of InteltechSms::BadRequest, @res[2], "send_multiple_sms returns BadRequest for 2nd element"
|
149
|
+
# assert_equal InteltechSms::BadRequest.new(LANDLINE_SMS, "2015"), @res[2]
|
150
|
+
# end
|
151
|
+
#
|
152
|
+
# end
|
153
|
+
# end
|
154
|
+
|
155
|
+
# --------------------------------------------------
|
156
|
+
# Code 2016 Identical message sent to this recipient. Please try again in a few seconds.
|
157
|
+
|
116
158
|
if defined? @@username
|
117
|
-
|
159
|
+
|
160
|
+
context "with a good username and secure_key" do
|
161
|
+
|
118
162
|
setup do
|
119
163
|
@good_gateway = InteltechSms.new(@@username, @@secure_key)
|
120
164
|
end
|
121
165
|
|
122
|
-
should "
|
166
|
+
should "reject the second of a pair of indentical messages" do
|
167
|
+
expected = InteltechSms::BadRequest.new(TEST_SMS, "2016")
|
168
|
+
@good_gateway.send_sms(TEST_SMS,'Test from Ruby - send two copies of single test sms via send_sms' << UNIQUE_STRING)
|
123
169
|
ex = assert_raises InteltechSms::Error do
|
124
|
-
@good_gateway.send_sms
|
170
|
+
@good_gateway.send_sms(TEST_SMS,'Test from Ruby - send two copies of single test sms via send_sms' << UNIQUE_STRING)
|
125
171
|
end
|
126
|
-
assert_equal InteltechSms::
|
127
|
-
end
|
128
|
-
|
129
|
-
should "return an array with BadRequest responses when send_multiple_sms is called with some bad numbers" do
|
130
|
-
@res = @good_gateway.send_multiple_sms [BAD_SMS, TEST_SMS, LANDLINE_SMS], 'Test from Ruby'
|
131
|
-
assert_kind_of Array, @res
|
132
|
-
assert_equal 3, @res.length, "send_multiple_sms returns results for each sms sent"
|
133
|
-
assert_kind_of InteltechSms::BadRequest, @res[0], "send_multiple_sms returns BadRequest for 1st element"
|
134
|
-
assert_equal InteltechSms::BadRequest.new(BAD_SMS, "2015"), @res[0]
|
135
|
-
assert_kind_of InteltechSms::Success, @res[1], "send_multiple_sms returns Success for 2nd element"
|
136
|
-
assert_equal InteltechSms::Success.new(TEST_SMS, "0000"), @res[1]
|
137
|
-
assert_kind_of InteltechSms::BadRequest, @res[2], "send_multiple_sms returns BadRequest for 2nd element"
|
138
|
-
assert_equal InteltechSms::BadRequest.new(LANDLINE_SMS, "2015"), @res[2]
|
172
|
+
assert_equal InteltechSms::Duplicate.new(TEST_SMS, "2016"), ex.response
|
139
173
|
end
|
140
174
|
|
141
175
|
end
|
@@ -155,13 +189,13 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
155
189
|
|
156
190
|
should "raise an NoCredit Error exception when send_sms is called" do
|
157
191
|
ex = assert_raises InteltechSms::Error do
|
158
|
-
@nocredit_gateway.send_sms TEST_SMS, '
|
192
|
+
@nocredit_gateway.send_sms TEST_SMS, 'Test from ruby - no credit on send_sms' << UNIQUE_STRING
|
159
193
|
end
|
160
194
|
assert_equal InteltechSms::NoCredit.new(TEST_SMS, "2018"), ex.response
|
161
195
|
end
|
162
196
|
|
163
197
|
should "return an array NoCredit responses when send_multiple_sms is called" do
|
164
|
-
@res = @nocredit_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby'
|
198
|
+
@res = @nocredit_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby - return an array NoCredit responses when send_multiple_sms is called' << UNIQUE_STRING
|
165
199
|
assert_kind_of Array, @res
|
166
200
|
assert_equal 2, @res.length, "send_multiple_sms returns results for each sms sent"
|
167
201
|
assert_kind_of InteltechSms::NoCredit, @res[0], "send_multiple_sms returns NoCredit for 1st element"
|
@@ -189,13 +223,13 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
189
223
|
|
190
224
|
should "raise an Unauthorized Error exception when send_sms is called" do
|
191
225
|
ex = assert_raises InteltechSms::Error do
|
192
|
-
@bad_gateway.send_sms TEST_SMS, '
|
226
|
+
@bad_gateway.send_sms TEST_SMS, 'Test from ruby - incorrect secure key send_sms call' << UNIQUE_STRING
|
193
227
|
end
|
194
228
|
assert_equal InteltechSms::Unauthorized.new(TEST_SMS, "2022"), ex.response
|
195
229
|
end
|
196
230
|
|
197
231
|
should "return an array Unauthorized responses when send_multiple_sms is called" do
|
198
|
-
@res = @bad_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby'
|
232
|
+
@res = @bad_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby - with incorrect key return an array Unauthorized responses when send_multiple_sms is called' << UNIQUE_STRING
|
199
233
|
assert_kind_of Array, @res
|
200
234
|
assert_equal 2, @res.length, "send_multiple_sms returns results for each sms sent"
|
201
235
|
assert_kind_of InteltechSms::Unauthorized, @res[0], "send_multiple_sms returns Unauthorized for 1st element"
|
@@ -220,13 +254,13 @@ class TestInteltechSms < Test::Unit::TestCase
|
|
220
254
|
|
221
255
|
should "raise an Unauthorized Error exception when send_sms is called" do
|
222
256
|
ex = assert_raises InteltechSms::Error do
|
223
|
-
@bad_gateway.send_sms TEST_SMS, '
|
257
|
+
@bad_gateway.send_sms TEST_SMS, 'Test from ruby - blank secure key send_sms call' << UNIQUE_STRING
|
224
258
|
end
|
225
259
|
assert_equal InteltechSms::Unauthorized.new(TEST_SMS, "2022"), ex.response
|
226
260
|
end
|
227
261
|
|
228
262
|
should "return an array Unauthorized responses when send_multiple_sms is called" do
|
229
|
-
@res = @bad_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby'
|
263
|
+
@res = @bad_gateway.send_multiple_sms [TEST_SMS, TEST_SMS2], 'Test from Ruby - with blank secure key return an array Unauthorized responses when send_multiple_sms is called' << UNIQUE_STRING
|
230
264
|
assert_kind_of Array, @res
|
231
265
|
assert_equal 2, @res.length, "send_multiple_sms returns results for each sms sent"
|
232
266
|
assert_kind_of InteltechSms::Unauthorized, @res[0], "send_multiple_sms returns Unauthorized for 1st element"
|
metadata
CHANGED
@@ -1,127 +1,142 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: inteltech_sms
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 3
|
10
|
-
version: 0.1.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Ian Heggie
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
type: :development
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
-
none: false
|
24
|
-
requirements:
|
25
|
-
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 31
|
28
|
-
segments:
|
29
|
-
- 3
|
30
|
-
- 12
|
31
|
-
version: "3.12"
|
32
|
-
version_requirements: *id001
|
12
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
33
15
|
name: rdoc
|
34
|
-
|
35
|
-
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.12'
|
36
22
|
type: :development
|
37
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
25
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
|
43
|
-
|
44
|
-
- 1
|
45
|
-
- 2
|
46
|
-
- 3
|
47
|
-
version: 1.2.3
|
48
|
-
version_requirements: *id002
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.12'
|
30
|
+
- !ruby/object:Gem::Dependency
|
49
31
|
name: bundler
|
50
|
-
|
51
|
-
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 1.2.3
|
52
38
|
type: :development
|
53
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
41
|
none: false
|
55
|
-
requirements:
|
56
|
-
- -
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
|
59
|
-
|
60
|
-
- 1
|
61
|
-
- 8
|
62
|
-
- 4
|
63
|
-
version: 1.8.4
|
64
|
-
version_requirements: *id003
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.2.3
|
46
|
+
- !ruby/object:Gem::Dependency
|
65
47
|
name: jeweler
|
66
|
-
|
67
|
-
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.8.4
|
68
54
|
type: :development
|
69
|
-
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
70
57
|
none: false
|
71
|
-
requirements:
|
72
|
-
- -
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
|
75
|
-
|
76
|
-
- 0
|
77
|
-
version: "0"
|
78
|
-
version_requirements: *id004
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.8.4
|
62
|
+
- !ruby/object:Gem::Dependency
|
79
63
|
name: travis
|
80
|
-
|
81
|
-
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
82
70
|
type: :development
|
83
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
84
73
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
89
|
-
|
90
|
-
- 0
|
91
|
-
version: "0"
|
92
|
-
version_requirements: *id005
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
93
79
|
name: travis-lint
|
94
|
-
|
95
|
-
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
96
86
|
type: :development
|
97
|
-
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
98
89
|
none: false
|
99
|
-
requirements:
|
100
|
-
- -
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
|
103
|
-
|
104
|
-
- 0
|
105
|
-
version: "0"
|
106
|
-
version_requirements: *id006
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
107
95
|
name: shoulda-context
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :development
|
108
103
|
prerelease: false
|
109
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: coveralls
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
description: Ruby gem that provides an InteltechSms class to check credit and send
|
127
|
+
SMS text messages to single or multiple recipients
|
110
128
|
email: ian@heggie.biz
|
111
129
|
executables: []
|
112
|
-
|
113
130
|
extensions: []
|
114
|
-
|
115
|
-
extra_rdoc_files:
|
131
|
+
extra_rdoc_files:
|
116
132
|
- LICENSE.txt
|
117
133
|
- README.rdoc
|
118
|
-
files:
|
134
|
+
files:
|
135
|
+
- .coveralls.yml
|
119
136
|
- .document
|
120
137
|
- .rbenv-gemsets
|
121
|
-
- .ruby-version
|
122
138
|
- .travis.yml
|
123
139
|
- Gemfile
|
124
|
-
- Gemfile.lock
|
125
140
|
- LICENSE.txt
|
126
141
|
- README.rdoc
|
127
142
|
- Rakefile
|
@@ -131,37 +146,31 @@ files:
|
|
131
146
|
- test/helper.rb
|
132
147
|
- test/test_inteltech_sms.rb
|
133
148
|
homepage: http://github.com/ianheggie/inteltech_sms
|
134
|
-
licenses:
|
149
|
+
licenses:
|
135
150
|
- MIT
|
136
151
|
post_install_message:
|
137
152
|
rdoc_options: []
|
138
|
-
|
139
|
-
require_paths:
|
153
|
+
require_paths:
|
140
154
|
- lib
|
141
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
142
156
|
none: false
|
143
|
-
requirements:
|
144
|
-
- -
|
145
|
-
- !ruby/object:Gem::Version
|
146
|
-
|
147
|
-
segments:
|
157
|
+
requirements:
|
158
|
+
- - ! '>='
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
segments:
|
148
162
|
- 0
|
149
|
-
|
150
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
|
+
hash: 206346697614286170
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
151
165
|
none: false
|
152
|
-
requirements:
|
153
|
-
- -
|
154
|
-
- !ruby/object:Gem::Version
|
155
|
-
|
156
|
-
segments:
|
157
|
-
- 0
|
158
|
-
version: "0"
|
166
|
+
requirements:
|
167
|
+
- - ! '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
159
170
|
requirements: []
|
160
|
-
|
161
171
|
rubyforge_project:
|
162
|
-
rubygems_version: 1.8.
|
172
|
+
rubygems_version: 1.8.23
|
163
173
|
signing_key:
|
164
174
|
specification_version: 3
|
165
175
|
summary: Ruby Gem to send SMS via inteltech.com.au
|
166
176
|
test_files: []
|
167
|
-
|
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.8.7-p371
|
data/Gemfile.lock
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
addressable (2.3.2)
|
5
|
-
backports (2.7.1)
|
6
|
-
coderay (1.0.8)
|
7
|
-
faraday (0.8.4)
|
8
|
-
multipart-post (~> 1.1)
|
9
|
-
faraday_middleware (0.9.0)
|
10
|
-
faraday (>= 0.7.4, < 0.9)
|
11
|
-
gh (0.9.1)
|
12
|
-
addressable
|
13
|
-
backports (~> 2.3)
|
14
|
-
faraday (~> 0.8)
|
15
|
-
multi_json (~> 1.0)
|
16
|
-
net-http-persistent (>= 2.7)
|
17
|
-
net-http-pipeline
|
18
|
-
git (1.2.5)
|
19
|
-
hashr (0.0.22)
|
20
|
-
highline (1.6.15)
|
21
|
-
jeweler (1.8.4)
|
22
|
-
bundler (~> 1.0)
|
23
|
-
git (>= 1.2.5)
|
24
|
-
rake
|
25
|
-
rdoc
|
26
|
-
json (1.7.6)
|
27
|
-
launchy (2.1.2)
|
28
|
-
addressable (~> 2.3)
|
29
|
-
method_source (0.8.1)
|
30
|
-
multi_json (1.5.0)
|
31
|
-
multipart-post (1.1.5)
|
32
|
-
net-http-persistent (2.8)
|
33
|
-
net-http-pipeline (1.0.1)
|
34
|
-
netrc (0.7.7)
|
35
|
-
pry (0.9.11.4)
|
36
|
-
coderay (~> 1.0.5)
|
37
|
-
method_source (~> 0.8)
|
38
|
-
slop (~> 3.4)
|
39
|
-
rake (10.0.3)
|
40
|
-
rcov (1.0.0)
|
41
|
-
rdoc (3.12)
|
42
|
-
json (~> 1.4)
|
43
|
-
shoulda-context (1.0.2)
|
44
|
-
simplecov (0.7.1)
|
45
|
-
multi_json (~> 1.0)
|
46
|
-
simplecov-html (~> 0.7.1)
|
47
|
-
simplecov-html (0.7.1)
|
48
|
-
slop (3.4.3)
|
49
|
-
travis (1.1.3)
|
50
|
-
backports (~> 2.6)
|
51
|
-
faraday (~> 0.8)
|
52
|
-
faraday_middleware (~> 0.9)
|
53
|
-
gh (~> 0.9)
|
54
|
-
highline (~> 1.6)
|
55
|
-
launchy (~> 2.1)
|
56
|
-
net-http-persistent (~> 2.8)
|
57
|
-
netrc (~> 0.7)
|
58
|
-
pry (~> 0.9)
|
59
|
-
travis-lint (1.5.0)
|
60
|
-
hashr (~> 0.0.22)
|
61
|
-
|
62
|
-
PLATFORMS
|
63
|
-
ruby
|
64
|
-
|
65
|
-
DEPENDENCIES
|
66
|
-
bundler (~> 1.2.3)
|
67
|
-
jeweler (~> 1.8.4)
|
68
|
-
rcov
|
69
|
-
rdoc (~> 3.12)
|
70
|
-
shoulda-context
|
71
|
-
simplecov
|
72
|
-
travis
|
73
|
-
travis-lint
|