rescue_each 1.0.0 → 1.0.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/lib/rescue_each.rb CHANGED
@@ -70,7 +70,7 @@ module Enumerable
70
70
  errors = []
71
71
  send options[:method] do |*args|
72
72
  begin
73
- yield *args
73
+ yield *args.dup
74
74
  rescue Exception => e
75
75
  item = RescueEach::Error::Item.new e, args
76
76
  if options[:stderr] == :full
@@ -66,6 +66,16 @@ class RescueEachTest < ActiveSupport::TestCase
66
66
  assert_equal [[2],[4],[6],[8],[10]], error_object.errors.map(&:args)
67
67
  end
68
68
 
69
+ test "error object contains args for Symbol#to_proc sugar" do
70
+ error_object = nil
71
+ begin
72
+ [42].rescue_each &:foo
73
+ rescue RescueEach::Error => e
74
+ error_object = e
75
+ end
76
+ assert_equal [[42]], error_object.errors.map(&:args)
77
+ end
78
+
69
79
  def foo_abc
70
80
  bar_def
71
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rescue_each
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Weathered