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

Tests fail when origin changed #148

Closed
mrmanc opened this issue Dec 13, 2018 · 2 comments
Closed

Tests fail when origin changed #148

mrmanc opened this issue Dec 13, 2018 · 2 comments

Comments

@mrmanc
Copy link
Contributor

mrmanc commented Dec 13, 2018

When the origin remote of a working copy is changed away from https://github.com/jekyll/github-metadata.git, the tests fail. The failing test contains this assertion: expect(subject.send(:git_remote_url)).to include("jekyll/github-metadata"). This is a head scratcher when running tests before pushing to a fork in preparation for contribution. I have some changes ready to resolve this.

@parkr
Copy link
Member

parkr commented Jan 2, 2019

@mrmanc Please PR!

mrmanc added a commit to autotraderuk/github-metadata that referenced this issue Jan 4, 2019
Tests were coupled to a specific origin meaning that tests against forks would fail. I’ve replaced the test that checks the output of `git_remote_url` is okay into a test to check `git_remotes` returns something, and another to check that `git_remote_url` correctly interprets the output from `git_remotes`.

I’ve also corrected the test doubles in later tests where (as part of jekyll#147) I had copied an incorrect bit of stubbing of `git_remote_url`. The stubbing appeared to be mimicking `git_remotes` instead. The test seemed to be passing by coincidence before. The stubbed output now matches what the function actually does.
@parkr parkr closed this as completed Jan 7, 2019
@parkr
Copy link
Member

parkr commented Jan 7, 2019

I believe #152 completed this!

@jekyll jekyll locked and limited conversation to collaborators Jan 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants