textveloper 0.1.4 → 0.1.5
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/lib/textveloper.rb +1 -1
- data/lib/textveloper/version.rb +1 -1
- data/spec/lib/textveloper_spec.rb +9 -0
- 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: 089589fb93931461027a780b5881d56ee9465ad1
|
4
|
+
data.tar.gz: 5e2146bc172b5b7f15bed6ee09c4df86498fa611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9c3161d05e0cb4f303af3bc257ea344ec56a252dc1ce9b9aa0019412d7eccc24ad92d02ee61f43aa9fb0d9dfe201d4b83713bf69c32581c4d9cb24f4039f06b
|
7
|
+
data.tar.gz: 38aa177ff67af188abf381cdd68112d59435f3f6bd827ee2b9c4f8b5b94322b406711252b4b094b72d541bb029d3c73ae5ff5a0cc994a498a14fde65daf144e8
|
data/lib/textveloper.rb
CHANGED
@@ -124,7 +124,7 @@ module Textveloper
|
|
124
124
|
|
125
125
|
def chunck_message(message)
|
126
126
|
#Leave space for pagination i.e: "BLAh blah blah (2/3)"
|
127
|
-
paginate(message.scan(/.{1,155}/).map(&:strip))
|
127
|
+
paginate(message.scan(/.{1,155}\b/).map(&:strip))
|
128
128
|
end
|
129
129
|
|
130
130
|
def paginate(arr)
|
data/lib/textveloper/version.rb
CHANGED
@@ -11,6 +11,7 @@ describe Textveloper do
|
|
11
11
|
let(:hash_response){{"transaccion"=>"exitosa", "mensaje_transaccion"=>"MENSAJE_ENVIADO"}}
|
12
12
|
let(:points){"{\"transaccion\":\"exitosa\",\"puntos_enviados\":\"0\",\"total_puntos\":\"0\",\"puntos_disponibles\":\"0\"}"}
|
13
13
|
let(:hash_response_points){{"transaccion"=>"exitosa", "puntos_enviados"=>"0", "total_puntos" => "0", "puntos_disponibles" => "0"}}
|
14
|
+
let(:mensaje_largo){"Doggy ipsizzle dolor black amizzle, yo mamma rizzle elit. Nullizzle its fo rizzle velizzle, fo volutpizzle, suscipizzle quis, ghetto vel, fizzle. Pellentesque crunk tortizzle. Sizzle pizzle. Sizzle izzle dolor nizzle turpis mofo gizzle. Maurizzle pellentesque shizzle my nizzle crocodizzle crackalackin turpizzle."}
|
14
15
|
let(:url){'http://api.textveloper.com/'}
|
15
16
|
|
16
17
|
|
@@ -68,5 +69,13 @@ describe Textveloper do
|
|
68
69
|
notificator.send(:hash_contructor,points).should eq(hash_response_points)
|
69
70
|
end
|
70
71
|
|
72
|
+
it "Divisor de mensajes" do
|
73
|
+
mensaje_cortado = ["Doggy ipsizzle dolor black amizzle, yo mamma rizzle elit. Nullizzle its fo rizzle velizzle, fo volutpizzle, suscipizzle quis, ghetto vel, fizzle. 1/3",
|
74
|
+
"Pellentesque crunk tortizzle. Sizzle pizzle. Sizzle izzle dolor nizzle turpis mofo gizzle. Maurizzle pellentesque shizzle my nizzle crocodizzle 2/3",
|
75
|
+
"crackalackin turpizzle 3/3"]
|
76
|
+
notificator.send(:chunck_message, mensaje_largo).should eq(mensaje_cortado)
|
77
|
+
|
78
|
+
end
|
79
|
+
|
71
80
|
|
72
81
|
end
|