mad_mimi_two 0.7.0 → 0.7.1

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.
@@ -23,12 +23,19 @@ module MadMimiTwo
23
23
  end
24
24
  # send http get url via http client wrapped with exception rescue code
25
25
  def send_cmd(url)
26
+ flag=true
27
+
26
28
  begin
27
29
  client= HTTPClient.new
28
- client.receive_timeout(60)
30
+ client.receive_timeout(100)
29
31
  res=client.get_content(url)
32
+
30
33
  rescue HTTPClient::BadResponseError
31
34
  res="problem retrieving status: #{res.inspect}"
35
+ rescue HTTPClient::ReceiveTimeoutError
36
+ res="problem retrieving status: #{res.inspect}"
37
+ res=client.get_content(url) if flag
38
+ flag=false
32
39
  end
33
40
  res
34
41
  end
@@ -71,7 +78,7 @@ module MadMimiTwo
71
78
  end
72
79
  def get_promotions
73
80
  res={'select promotion'=>'select promotion'}
74
- 1.upto(5) { |i| #only up to three pages now
81
+ 1.upto(7) { |i| #only up to three pages now
75
82
  tmp=get_promotions_internal(i)
76
83
  puts "i is #{i} tmp size is #{tmp.size}"
77
84
  break if tmp.empty?
@@ -80,9 +80,15 @@ class TestMadMimiTwo < Test::Unit::TestCase
80
80
  # puts "message id: 1159748168" (old message id) PUT IN ONE OF YOUR MESSAGE IDs to check
81
81
  t=MadMimiTwo::MadMimiMessage.new
82
82
  r=t.check_status('1159748168')
83
- puts "'r is ' #{r}"
83
+ puts "'check status is ' #{r}"
84
84
  assert r.class==String, "response is not string r is: #{r} #{r.class}"
85
85
  assert r=='sent', "message response not correct: #{r}"
86
86
 
87
87
  end
88
+ def test_promos
89
+ t=MadMimiTwo::MadMimiMessage.new
90
+ r=t.get_promotions()
91
+ puts "get promos #{r}"
92
+ assert r!=nil, "r is nil"
93
+ end
88
94
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 7
8
- - 0
9
- version: 0.7.0
8
+ - 1
9
+ version: 0.7.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - scott sproule