fake-resque 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -32,6 +32,15 @@ Usage
32
32
 
33
33
  FakeResque.activate!
34
34
 
35
+ # By default FakeResque will swallow any errors. To raise errors
36
+
37
+ FakeResque.raise_errors!
38
+
39
+ # To restore the original behavior of swallowing errors
40
+
41
+ FakeResque.suppress_errors!
42
+
43
+
35
44
  Installation
36
45
  ------------
37
46
 
@@ -65,4 +74,4 @@ Meta
65
74
 
66
75
  [0]: http://help.github.com/forking/
67
76
  [1]: http://github.com/jacobat/fake-resque/issues
68
- [2]: http://github.com/defunkt/fakefs
77
+ [2]: http://github.com/defunkt/fakefs
@@ -20,6 +20,18 @@ module FakeResque
20
20
  def self.unblock!
21
21
  Resque.unblock!
22
22
  end
23
+
24
+ def self.raise_errors!
25
+ @raise_errors = true
26
+ end
27
+
28
+ def self.suppress_errors!
29
+ @raise_errors = false
30
+ end
31
+
32
+ def self.raise_errors?
33
+ @raise_errors
34
+ end
23
35
  end
24
36
 
25
37
  Resque.extend(FakeResque::Faker)
@@ -10,7 +10,10 @@ module FakeResque
10
10
  job.perform
11
11
  rescue Object=>e
12
12
  job.fail(e)
13
- # Eat the error because logically it happened in a worker
13
+
14
+ if FakeResque.raise_errors?
15
+ raise e
16
+ end
14
17
  end
15
18
  end
16
19
  end
@@ -18,7 +21,7 @@ module FakeResque
18
21
  def block!
19
22
  @forward = false
20
23
  end
21
-
24
+
22
25
  def unblock!
23
26
  @forward = true
24
27
  end
@@ -1,6 +1,6 @@
1
1
  module FakeResque
2
2
  module Version
3
- VERSION = "0.3.0"
3
+ VERSION = "0.4.0"
4
4
 
5
5
  def self.to_s
6
6
  VERSION
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake-resque
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
8
+ - 4
9
9
  - 0
10
- version: 0.3.0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jacon Atzen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-09-27 00:00:00 Z
18
+ date: 2012-04-29 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: A fake resque. Use it in your tests.
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  requirements: []
70
70
 
71
71
  rubyforge_project: fake-resque
72
- rubygems_version: 1.8.5
72
+ rubygems_version: 1.8.23
73
73
  signing_key:
74
74
  specification_version: 3
75
75
  summary: A fake resque. Use it in your tests.