Permalink
Browse files

Updated gems.

  • Loading branch information...
1 parent a059c05 commit ae09f574fc52415c9f5a1834e1d72e1e30073381 @treeder treeder committed May 22, 2013
Showing with 20 additions and 39 deletions.
  1. +5 −4 Gemfile.lock
  2. +15 −35 test/test_iron_mq.rb
View
9 Gemfile.lock
@@ -15,23 +15,24 @@ GEM
ffi (1.8.1)
go (1.1.0)
concur
- iron_core (0.6.1)
+ iron_core (0.6.2)
rest (>= 2.2.0)
iron_worker_ng (0.16.4)
bundler (>= 1.2.0)
iron_core (>= 0.5.1)
rubyzip (>= 0.9.9)
mime-types (1.23)
- minitest (4.7.4)
+ minitest (5.0.2)
net-http-persistent (2.8)
quicky (0.4.0)
rake (10.0.4)
- rest (2.6.0)
+ rest (2.6.2)
+ net-http-persistent
rest-client (>= 0.3.0)
rest-client (1.6.7)
mime-types (>= 1.16)
rubyzip (0.9.9)
- test-unit (2.5.4)
+ test-unit (2.5.5)
typhoeus (0.6.3)
ethon (~> 0.5.11)
uber_config (1.0.5)
View
50 test/test_iron_mq.rb
@@ -271,15 +271,15 @@ def test_delay
msgTxt = "testMessage-"+Time.now.to_s
# puts msgTxt
queue = @client.queue(queue_name)
- queue.post(msgTxt, {:delay => 5})
+ msg_id = queue.post(msgTxt, {:delay => 5}).id
msg = queue.get
# p msg
assert_nil msg
sleep 6
new_msg = queue.get
assert_not_nil new_msg
- assert_equal new_msg.id, msg.id
+ assert_equal msg_id, new_msg.id
new_msg.delete
# delete queue on test complete
@@ -381,9 +381,9 @@ def test_peek
end
def test_touch
- puts "test_message_touch_2"
+ puts "in test_touch"
- queue_name = "test_msg_touch"
+ queue_name = "test_msg_touch_3"
clear_queue(queue_name)
queue = @client.queue(queue_name)
@@ -402,7 +402,9 @@ def test_touch
msgs = queue.peek(:n => 3) # all messages from queue
assert_equal Array, msgs.class, "waiting for Array, but got #{msgs.class}"
assert_equal 2, msgs.size, "API must return only 2 messages"
- msgs.each { |m| assert_not_equal msg.id, m.id, "returned message which must be reserved" }
+ msgs.each do |m|
+ assert_not_equal msg.id, m.id, "returned a message which must be reserved"
+ end
sleep 20 # ensure timeout is passed
@@ -486,42 +488,20 @@ def test_release
# p msg
assert_nil msgr
- tries = MAX_TRIES
- while tries > 0
- sleep 0.5
- tries -= 1
- sleep 1
-
- msg = queue.get
- next if msg.nil?
-
- #p msg
- assert_equal msg.id, msg_id
-
- break
- end
- assert_not_equal tries, 0
+ sleep 11
+ msg = queue.get
+ assert_not_nil msg
+ assert_equal msg_id, msg.id
msg.release(:delay => 5)
msg = queue.get
# p msg
assert_nil msg
- tries = MAX_TRIES
- while tries > 0
- sleep 0.5
- tries -= 1
- sleep 1
-
- msg = queue.get
- next if msg.nil?
-
- # p msg
- assert_equal msg.id, msg_id
-
- break
- end
- assert_not_equal tries, 0
+ sleep 6
+ msg = queue.get
+ assert_not_nil msg
+ assert_equal msg_id, msg.id
# delete queue on test complete
resp = queue.delete_queue

0 comments on commit ae09f57

Please sign in to comment.