Skip to content

Better error messages for empty string ENV variables #940

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

Merged
merged 1 commit into from
Aug 14, 2017
Merged

Better error messages for empty string ENV variables #940

merged 1 commit into from
Aug 14, 2017

Conversation

vignesh-sankaran
Copy link
Contributor

Fixes up #937, which was caused by me not having the TEST_DATABASE_URL set i.e. it was TEST_DATABASE_URL=. Thanks to Arnavion on the #rust channel for pointing out I could use unwrap_or() to cover both the None and "" cases at once :).

src/tests/all.rs Outdated
@@ -138,11 +138,17 @@ fn app() -> (record::Bomb, Arc<App>, conduit_middleware::MiddlewareBuilder) {
return (bomb, app, middleware);
}

/// Returnx the environment variable only if it has been defined
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are doc comments visible in integration tests? I don't think they are.

Copy link
Member

Choose a reason for hiding this comment

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

AFAIK tests don't show up in documentation at all. While you're changing this to be a regular comment, could you remove the stray "x" at the end of "Returnx" too please? :)

src/tests/all.rs Outdated
@@ -138,11 +138,17 @@ fn app() -> (record::Bomb, Arc<App>, conduit_middleware::MiddlewareBuilder) {
return (bomb, app, middleware);
}

/// Returnx the environment variable only if it has been defined
Copy link
Member

Choose a reason for hiding this comment

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

AFAIK tests don't show up in documentation at all. While you're changing this to be a regular comment, could you remove the stray "x" at the end of "Returnx" too please? :)

@carols10cents
Copy link
Member

bors: r+

bors-voyager bot added a commit that referenced this pull request Aug 14, 2017
940: Better error messages for empty string ENV variables r=carols10cents

Fixes up #937, which was caused by me not having the `TEST_DATABASE_URL` set i.e. it was `TEST_DATABASE_URL=`. Thanks to Arnavion on the #rust channel for pointing out I could use unwrap_or() to cover both the `None` and `""` cases at once :).
@bors-voyager
Copy link
Contributor

bors-voyager bot commented Aug 14, 2017

Build succeeded

@bors-voyager bors-voyager bot merged commit 6a22f97 into rust-lang:master Aug 14, 2017
@vignesh-sankaran vignesh-sankaran deleted the test-db-url-fix branch August 14, 2017 01:29
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.

3 participants