Skip to content

Commit 5fdb921

Browse files
committed
chore: code style
1 parent 73e2d4a commit 5fdb921

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,5 @@ This plugin afford math related expectations.
6565
$$\mid -3 \mid$$
6666
```php
6767
expect(3)->toBeAbsoluteOf(-3);
68-
expect(3)->not->toBeAbsoluteOf(4);
68+
expect(-3)->not->toBeAbsoluteOf(-3);
6969
```

src/Expectation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,6 @@ public function toBeFactorialOf(int $number): PestExpectation
133133
*/
134134
public function toBeAbsoluteOf(int|float $number): PestExpectation
135135
{
136-
return expect($this->value === abs($number))->toBeTrue("$this->value !== abs($number)");
136+
return expect($this->value === abs($number))->toBeTrue("$this->value doesn't equal abs($number)");
137137
}
138138
}

tests/toBeAbsolute.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
})->with([1, 3, 5, 7, 9, 4.6, 7.8]);
99

1010
it('passes not', function (int|float $number): void {
11-
expect($number + 1)->not->toBeAbsoluteOf($number)
12-
->and($number + 1)->not->toBeAbsoluteOf(-$number);
11+
expect(-$number)->not->toBeAbsoluteOf($number)
12+
->and(-$number)->not->toBeAbsoluteOf(-$number);
1313
})->with([1, 3, 5, 7, 9, 4.6, 7.8]);
1414

1515
test('failures', function (): void {
1616
expect(-8)->toBeAbsoluteOf(8);
17-
})->throws(ExpectationFailedException::class);
17+
})->throws(ExpectationFailedException::class, "-8 doesn't equal abs(8)");
1818

1919
test('failures not', function (): void {
20-
expect(8)->not->toBeAbsoluteOf(8);
20+
expect(8)->not->toBeAbsoluteOf(-8);
2121
})->throws(ExpectationFailedException::class);

0 commit comments

Comments
 (0)