lib/rubocop/cop/rspec/expect_change.rb in rubocop-rspec-2.11.1 vs lib/rubocop/cop/rspec/expect_change.rb in rubocop-rspec-2.12.0
- old
+ new
@@ -8,27 +8,27 @@
# Enforces either passing object and attribute as arguments to the matcher
# or passing a block that reads the attribute value.
#
# This cop can be configured using the `EnforcedStyle` option.
#
- # @example `EnforcedStyle: block`
+ # @example `EnforcedStyle: method_call` (default)
# # bad
- # expect { run }.to change(Foo, :bar)
- #
- # # good
# expect { run }.to change { Foo.bar }
- #
- # @example `EnforcedStyle: method_call`
- # # bad
- # expect { run }.to change { Foo.bar }
# expect { run }.to change { foo.baz }
#
# # good
# expect { run }.to change(Foo, :bar)
# expect { run }.to change(foo, :baz)
# # also good when there are arguments or chained method calls
# expect { run }.to change { Foo.bar(:count) }
# expect { run }.to change { user.reload.name }
+ #
+ # @example `EnforcedStyle: block`
+ # # bad
+ # expect { run }.to change(Foo, :bar)
+ #
+ # # good
+ # expect { run }.to change { Foo.bar }
#
class ExpectChange < Base
extend AutoCorrector
include ConfigurableEnforcedStyle