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

Update travis configuration #228

Merged
merged 3 commits into from
May 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 28 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
language: rust
rust:
- nightly-2019-05-09

before_script: |
rustup component add rustfmt clippy
script: |
cargo fmt --all -- --check &&
cargo clippy --all --all-features -- -D clippy::all &&
cargo build --no-default-features --verbose &&
cargo build --all --all-features --verbose &&
cargo test --all --all-features --verbose
rust: nightly-2019-05-09
cache: cargo

matrix:
include:
- name: cargo doc
env: [CACHE_NAME=docs]
script:
- RUSTDOCFLAGS=-Dwarnings
cargo doc --all --all-features --no-deps --exclude tide

- name: cargo fmt
cache: false
before_script: rustup component add rustfmt
script: cargo fmt --all -- --check

- name: cargo clippy
env: [CACHE_NAME=clippy]
before_script: rustup component add clippy
script: cargo clippy --all --all-targets --exclude examples -- -Dwarnings

- name: cargo build --no-default-features
env: [CACHE_NAME=no-default-features]
script:
- cargo build --manifest-path tide/Cargo.toml --no-default-features
- cargo build --manifest-path tide-core/Cargo.toml --no-default-features

- name: cargo test
script: cargo test --all --verbose
6 changes: 2 additions & 4 deletions tide-compression/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@ mod tests {
.header(ACCEPT_ENCODING, hval)
.body(Body::empty())
.unwrap();
let res = server.simulate(req).unwrap();
res
server.simulate(req).unwrap()
}

// Generates a decoded response given a request body and the header value representing its encoding.
Expand All @@ -301,8 +300,7 @@ mod tests {
.header(CONTENT_ENCODING, hval)
.body(body)
.unwrap();
let res = server.simulate(req).unwrap();
res
server.simulate(req).unwrap()
}

#[test]
Expand Down
11 changes: 7 additions & 4 deletions tide-cookies/src/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tide_core::{

/// Middleware to work with cookies.
///
/// [`CookiesMiddleware`] along with [`ContextExt`](crate::cookies::ContextExt) provide smooth
/// [`CookiesMiddleware`] along with [`ContextExt`](crate::data::ContextExt) provide smooth
/// access to request cookies and setting/removing cookies from response. This leverages the
/// [cookie](https://crates.io/crates/cookie) crate.
/// This middleware parses cookies from request and caches them in the extension. Once the request
Expand Down Expand Up @@ -74,7 +74,11 @@ mod tests {

/// Tide will use the the `Cookies`'s `Extract` implementation to build this parameter.
async fn retrieve_cookie(mut cx: Context<()>) -> String {
format!("{}", cx.get_cookie(COOKIE_NAME).unwrap().unwrap().value())
cx.get_cookie(COOKIE_NAME)
.unwrap()
.unwrap()
.value()
.to_string()
}

async fn set_cookie(mut cx: Context<()>) {
Expand Down Expand Up @@ -109,8 +113,7 @@ mod tests {
.header(http::header::COOKIE, "testCookie=RequestCookieValue")
.body(Body::empty())
.unwrap();
let res = server.simulate(req).unwrap();
res
server.simulate(req).unwrap()
}

#[test]
Expand Down