Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Add missing spec for ContainsProductRuleChecker #3340

Conversation

PWalkow
Copy link
Contributor

@PWalkow PWalkow commented Sep 23, 2015

Q A
Bug fix? [no]
New feature? [no]
BC breaks? [no]
Deprecations? [no]
Fixed tickets []
License MIT
Doc PR [missing Specs for RuleChecker]

@PWalkow PWalkow force-pushed the add-missing-spec-for-contains-product-rule-checker branch from 0197dec to 76ce9ec Compare September 23, 2015 11:28
@PWalkow PWalkow changed the title Add missing spec for ContainsProductRuleChecker [Core] Add missing spec for ContainsProductRuleChecker Sep 23, 2015
@PWalkow PWalkow force-pushed the add-missing-spec-for-contains-product-rule-checker branch from 76ce9ec to 4275c5a Compare September 23, 2015 11:30
$this->shouldImplement('Sylius\Component\Promotion\Checker\RuleCheckerInterface');
}

function it_throw_exception_on_invalid_subject(PromotionSubjectInterface $subject)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

throws

@PWalkow PWalkow force-pushed the add-missing-spec-for-contains-product-rule-checker branch from 4275c5a to 4d3201e Compare September 23, 2015 11:40
OrderItem $orderItem,
ProductVariant $variant
) {
$subject->getItems()->shouldBeCalled()->willReturn([$orderItem]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldBeCalled() is useless when you use willReturn(). Don't use mocks & stubs to test same thing!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldBeCalled() says explicitly that some method should be called (spec should be as readable as possible) and gives us faster and direct feedback if something that should be called hasn't been called.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you misunderstand purposes of those two things, I have already explained it some time ago but don't have time now to do this again (as well for looking across the PRs to find those notes), please read:

@PWalkow PWalkow force-pushed the add-missing-spec-for-contains-product-rule-checker branch from 4d3201e to abe6d7a Compare September 23, 2015 13:03
@PWalkow
Copy link
Contributor Author

PWalkow commented Sep 23, 2015

Removed 'shouldBeCalled'

pjedrzejewski pushed a commit that referenced this pull request Oct 21, 2015
…roduct-rule-checker

[Core] Add missing spec for ContainsProductRuleChecker
@pjedrzejewski pjedrzejewski merged commit 7a04c6e into Sylius:master Oct 21, 2015
@pjedrzejewski
Copy link
Member

Thanks @PWalkow!

@PWalkow PWalkow deleted the add-missing-spec-for-contains-product-rule-checker branch October 21, 2015 15:39
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
…ains-product-rule-checker

[Core] Add missing spec for ContainsProductRuleChecker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants