smq 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
data/lib/smq/message.rb CHANGED
@@ -61,6 +61,11 @@ module SMQ
61
61
  save!
62
62
  end
63
63
 
64
+ def ack_and_delete!
65
+ ack!
66
+ destroy
67
+ end
68
+
64
69
  end
65
70
 
66
71
  end
data/test/test_message.rb CHANGED
@@ -65,6 +65,14 @@ class MessageTest < Test::Unit::TestCase
65
65
  assert_not_nil @msg.id
66
66
  end
67
67
 
68
+ def test_ack_delete_marks_message_as_complete_and_deletes
69
+ @msg.ack_and_delete!
70
+ assert @msg.frozen?
71
+ assert_raise ActiveRecord::RecordNotFound do
72
+ SMQ::Message.find(@msg.id)
73
+ end
74
+ end
75
+
68
76
  def test_should_lock_an_unlocked_message
69
77
  @msg.save!
70
78
  msg = @msg.lock!(@worker)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tim Blair
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-08 00:00:00 +01:00
17
+ date: 2010-04-26 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency