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

Add new namer that looks for approval files in same folder as assembly #219

Merged
merged 1 commit into from Mar 27, 2019
Merged

Add new namer that looks for approval files in same folder as assembly #219

merged 1 commit into from Mar 27, 2019

Conversation

hartmark
Copy link

@hartmark hartmark commented May 9, 2018

I had same problems as in #66, used just the namer from PR #71.

To use just call this in your test:
Approvals.RegisterDefaultNamerCreation(() => new UnitTestFrameworkNamerAssemblyLocation());

One limitation is that if your test is in a sub-folder you need a post-build copy to destination folder for example:
copy /y $(ProjectDir)**subfolder**\*.approved.txt $(TargetDir)

@isidore isidore merged commit 5069f87 into approvals:master Mar 27, 2019
@isidore
Copy link
Member

isidore commented Mar 27, 2019

Thanks,
I've add this and added a the method Approvals.UseAssemblyLocationForNames() to make it a bit more discoverable (also added docs)

@isidore
Copy link
Member

isidore commented Mar 27, 2019

published in ApprovalTests 3.0.22

@hartmark
Copy link
Author

Cool, I'll check it out when I have the time

1 similar comment
@hartmark
Copy link
Author

Cool, I'll check it out when I have the time

@hartmark hartmark deleted the AssemblyLocationNamer branch March 27, 2019 19:53
@davidalpert
Copy link

many thanks @hartmark and @isidore I ran into this problem today and using Approvals.UseAssemblyLocationForNames() and the post-build step worked like a charm.

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.

None yet

3 participants