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 an option where the consumer of the library can set the host #123

Merged
merged 2 commits into from
Nov 9, 2017

Conversation

waelemara
Copy link

{

var sslOption = enableSsl ? " --ssl" : "";
return $"-p {port} -l \"{logFilePath}\" --pact-dir \"{pactFileDir}\" --pact-specification-version \"{pactSpecificationVersion}\" --consumer \"{consumerName}\" --provider \"{providerName}\"{sslOption}";
var hostOption = string.IsNullOrWhiteSpace(host) ? "" : $" --host={host}";
Copy link
Member

Choose a reason for hiding this comment

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

Can we flip the condition so the else case is ""? Same as the one above.

: this(
baseUri => new RubyHttpHost(baseUri, consumerName, providerName, config),
baseUri => new RubyHttpHost(baseUri, consumerName, providerName, config,host),
Copy link
Member

@neilcampbell neilcampbell Nov 8, 2017

Choose a reason for hiding this comment

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

RubyHttpHost should not need to take in the host, you should update the baseUri to reflect the host that is being used.

This is done by passing host to the MockProviderService internal ctor and changing BaseUri = new Uri($"{(enableSsl ? "https" : "http")}://localhost:{port}"); to BaseUri = new Uri($"{(enableSsl ? "https" : "http")}://{host}:{port}");

consumerName,
providerName, config)),
providerName, config, host)),
Copy link
Member

Choose a reason for hiding this comment

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

Once below comment is actioned you can use baseUri.host

@neilcampbell neilcampbell merged commit e883aab into pact-foundation:master Nov 9, 2017
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

2 participants