diff --git a/lib/chefspec.rb b/lib/chefspec.rb index 3301b3c0..c1a294f3 100644 --- a/lib/chefspec.rb +++ b/lib/chefspec.rb @@ -10,7 +10,7 @@ module ChefSpec # @return [self] # def define_matcher(resource_name) - matchers[resource_name.to_sym] = Proc.new do |identity| + matchers[resource_name.to_sym] = proc do |identity| find_resource(resource_name, identity) end diff --git a/lib/chefspec/matchers/notifications_matcher.rb b/lib/chefspec/matchers/notifications_matcher.rb index 8b31eaff..ee699e7e 100644 --- a/lib/chefspec/matchers/notifications_matcher.rb +++ b/lib/chefspec/matchers/notifications_matcher.rb @@ -12,7 +12,7 @@ def matches?(resource) @resource = resource if @resource - block = Proc.new do |notified| + block = proc do |notified| resource_name(notified.resource).to_s == @expected_resource_type && (@expected_resource_name === notified.resource.identity.to_s || @expected_resource_name === notified.resource.name.to_s) && matches_action?(notified) diff --git a/lib/chefspec/stubs/stub.rb b/lib/chefspec/stubs/stub.rb index 1570308a..c418ed50 100644 --- a/lib/chefspec/stubs/stub.rb +++ b/lib/chefspec/stubs/stub.rb @@ -9,7 +9,7 @@ def and_return(value) end def and_raise(exception) - @block = Proc.new { raise exception } + @block = proc { raise exception } self end