Skip to content

Commit

Permalink
1️⃣ Correct off by one error in an example (#731)
Browse files Browse the repository at this point in the history
Co-authored-by: sabon <mail@velvetshark.com>
  • Loading branch information
rzadp and velvet-shark committed May 16, 2022
1 parent e69f739 commit a39f6f7
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/mock-contract.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Mock contract will be used to mock exactly this call with values that are releva
expect(await contract.check()).to.be.equal(false);
});
it('returns true if the wallet has at least 1000000 coins', async () => {
it('returns true if the wallet has more than 1000000 coins', async () => {
const {contract, mockERC20} = await setup();
await mockERC20.mock.balanceOf.returns(utils.parseEther('1000001'));
expect(await contract.check()).to.equal(true);
Expand Down
2 changes: 1 addition & 1 deletion examples/called-on-contract/test/AmIRichAlready.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Am I Rich Already', () => {
expect('balanceOf').to.be.calledOnContract(ERC20);
});

it('returns true if the wallet has at least 1000000 coins', async () => {
it('returns true if the wallet has more than 1000000 coins', async () => {
ERC20 = await deployContract(wallet, BasicToken, [utils.parseEther('1000001')]);
contract = await deployContract(wallet, AmIRichAlready, [ERC20.address]);
expect(await contract.check()).to.equal(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ describe('Am I Rich Already', () => {
expect(await contract.check()).to.be.equal(false);
});

it('returns true if the wallet has at least 1000000 coins', async () => {
it('returns true if the wallet has more than 1000000 coins', async () => {
await mockERC20.mock.balanceOf
.withArgs(wallet.address)
.returns(utils.parseEther('1000000'));
expect(await contract.check()).to.be.equal(false);
.returns(utils.parseEther('1000001'));
expect(await contract.check()).to.be.equal(true);
});
});
2 changes: 1 addition & 1 deletion examples/mock-contracts/test/AmIRichAlready.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('Am I Rich Already', () => {
expect(await contract.check()).to.be.equal(false);
});

it('returns true if the wallet has at least 1000000 coins', async () => {
it('returns true if the wallet has more than 1000000 coins', async () => {
await mockERC20.mock.balanceOf.returns(utils.parseEther('1000001'));
expect(await contract.check()).to.equal(true);
});
Expand Down
2 changes: 1 addition & 1 deletion waffle-mock-contract/test/amirichalready.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('Am I Rich Already', () => {
expect(await contract.check()).to.be.equal(false);
});

it('returns true if the wallet has at least 1000000 coins', async () => {
it('returns true if the wallet has more than 1000000 coins', async () => {
await mockERC20.mock.balanceOf.returns(utils.parseEther('1000001'));
expect(await contract.check()).to.equal(true);
});
Expand Down

0 comments on commit a39f6f7

Please sign in to comment.