-
Notifications
You must be signed in to change notification settings - Fork 99
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
Implement inner spec #1102
Open
soonhong99
wants to merge
2
commits into
naver:main
Choose a base branch
from
soonhong99:implement-InnerSpec
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Implement inner spec #1102
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당
property
를 설정할 때propertyName
은"value"
,value
는"expected"
로 명시적으로 설정하고 있습니다.그런데
.sample()
을 호출하면, Fixture Monkey의 랜덤 데이터 생성 로직에 따라CustomObject.value
가 랜덤 값으로 채워지는 것 같습니다. 이 경우"expected"
라는 값은 실질적으로 적용되지 않고 다른 랜덤 값으로 덮어씌워질 가능성이 있는데요.그렇다면,
"expected"
값을 명시적으로 설정할 수 있도록 설계한 이유가 무엇인지 궁금합니다. 이 설정이 랜덤 데이터 생성 과정에서 어떤 역할을 하며, 왜 이러한 구조가 필요했는지 알고 싶습니다.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
랜덤 값으로 채워지는 결과가 나왔다면 receiver가 가르키는 대상이 달라지면서 기존과 동작이 달라지게 된 게 아닌가 싶은데요.
원래 기본적인
set
API은 고정된 값을 설정해야할 때 사용하는 API입니다.아마 동작이 기존과 다르게 랜덤하게 나와서 헷갈리셨을 것 같습니다.
원래 동작은 아래와 같습니다. 아래 검증문이 항상 성립하게 됩니다.
m의 scope 내에서는 m이 this가 되고, e 의 scope 내에서는 e가 this가 되는 방향으로 구현이 되야됩니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 그렇군요! 그렇다면 제가 구현한 방식은 잘못된 구현방식일까요?
then(actual.values.first().value).isEqualTo("expected")
해당 then 구절이 항상 성립하는 방향으로 구현해야할까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵, 아래 then 구절이 성립하는 방향으로 구현해야 합니다.
InstantiatorDslSpec
구현을 참조해보시면 좋을 것 같습니다.아래와 같이 사용할 수 있습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 내용 자세히 설명해주셔서 감사합니다! 말씀해주신 내용대로 동작할 수 있도록 수정하겠습니다.