|
68 | 68 | expect { foo }.to change { Foo.bar }.by(0).and change { Foo.baz }.by(0)
|
69 | 69 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
70 | 70 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
| 71 | + expect { foo }.to change(Foo, :bar).by(0).and change(Foo, :baz) |
| 72 | + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
| 73 | + expect { foo }.to change { Foo.bar }.and change { Foo.baz }.by(0) |
| 74 | + ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
71 | 75 | end
|
72 | 76 | RUBY
|
73 | 77 |
|
|
84 | 88 | expect { foo }.to change { Foo.bar }.by(0) & change { Foo.baz }.by(0)
|
85 | 89 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
86 | 90 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
| 91 | + expect { foo }.to change(Foo, :bar).by(0) & change(Foo, :baz) |
| 92 | + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
| 93 | + expect { foo }.to change { Foo.bar } & change { Foo.baz }.by(0) |
| 94 | + ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
87 | 95 | end
|
88 | 96 | RUBY
|
89 | 97 |
|
|
100 | 108 | expect { foo }.to change { Foo.bar }.by(0).or change { Foo.baz }.by(0)
|
101 | 109 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
102 | 110 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
| 111 | + expect { foo }.to change(Foo, :bar).by(0).or change(Foo, :baz) |
| 112 | + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
| 113 | + expect { foo }.to change { Foo.bar }.or change { Foo.baz }.by(0) |
| 114 | + ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
103 | 115 | end
|
104 | 116 | RUBY
|
105 | 117 |
|
|
116 | 128 | expect { foo }.to change { Foo.bar }.by(0) | change { Foo.baz }.by(0)
|
117 | 129 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
118 | 130 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`.
|
| 131 | + expect { foo }.to change(Foo, :bar) | change(Foo, :baz).by(0) |
| 132 | + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
| 133 | + expect { foo }.to change { Foo.bar }.by(0) | change { Foo.baz } |
| 134 | + ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer negated matchers with compound expectations over `change.by(0)`. |
119 | 135 | end
|
120 | 136 | RUBY
|
121 | 137 |
|
|
244 | 260 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `not_change` with compound expectations over `change.by(0)`.
|
245 | 261 | .and change { Foo.baz }.by(0)
|
246 | 262 | ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `not_change` with compound expectations over `change.by(0)`.
|
| 263 | + expect { foo } |
| 264 | + .to change(Foo, :bar) |
| 265 | + .and change(Foo, :baz).by(0) |
| 266 | + ^^^^^^^^^^^^^^^^^^^^^^^ Prefer `not_change` with compound expectations over `change.by(0)`. |
| 267 | + expect { foo } |
| 268 | + .to change { Foo.bar } |
| 269 | + .and change { Foo.baz }.by(0) |
| 270 | + ^^^^^^^^^^^^^^^^^^^^^^^^ Prefer `not_change` with compound expectations over `change.by(0)`. |
247 | 271 | end
|
248 | 272 | RUBY
|
249 | 273 |
|
|
255 | 279 | expect { foo }
|
256 | 280 | .to not_change { Foo.bar }
|
257 | 281 | .and not_change { Foo.baz }
|
| 282 | + expect { foo } |
| 283 | + .to change(Foo, :bar) |
| 284 | + .and not_change(Foo, :baz) |
| 285 | + expect { foo } |
| 286 | + .to change { Foo.bar } |
| 287 | + .and not_change { Foo.baz } |
258 | 288 | end
|
259 | 289 | RUBY
|
260 | 290 | end
|
|
0 commit comments