anticipate 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,7 @@ require 'anticipate/anticipator'
5
5
  require 'anticipate/dsl'
6
6
 
7
7
  module Anticipate
8
- VERSION = '0.1.0'
8
+ VERSION = '0.1.1'
9
9
 
10
10
  include DSL
11
11
  end
@@ -10,7 +10,6 @@ module Anticipate
10
10
  count = -1
11
11
  begin
12
12
  yield
13
- return
14
13
  rescue Exception => e
15
14
  if (count += 1) == tries
16
15
  raise TimeoutError.new(interval, tries, e)
@@ -28,6 +28,14 @@ module Anticipate
28
28
  end
29
29
  }.should_not raise_error
30
30
  end
31
+
32
+ it "returns what the block returns" do
33
+ tries = 0
34
+ @anticipator.anticipate(1,2) do
35
+ raise "fail" unless (tries += 1) == 2
36
+ "dude, don't forget me!"
37
+ end.should == "dude, don't forget me!"
38
+ end
31
39
  end
32
40
 
33
41
  describe "when the block eventually stops raising an Exception (that is not a StandardError)" do
@@ -72,6 +80,12 @@ module Anticipate
72
80
  end
73
81
  }.should_not raise_error
74
82
  end
83
+
84
+ it "returns what the block returns" do
85
+ @anticipator.anticipate(1,2) do
86
+ "dude, don't forget me!"
87
+ end.should == "dude, don't forget me!"
88
+ end
75
89
  end
76
90
  end
77
91
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anticipate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-24 00:00:00.000000000 Z
12
+ date: 2013-06-10 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Fluent interface for try-rescue-sleep-retry-abort
15
15
  email: joshuachisholm@gmail.com
@@ -51,5 +51,5 @@ rubyforge_project:
51
51
  rubygems_version: 1.8.24
52
52
  signing_key:
53
53
  specification_version: 3
54
- summary: anticipate-0.1.0
54
+ summary: anticipate-0.1.1
55
55
  test_files: []