Skip to content

Commit

Permalink
Upgrade to latest serde_yaml
Browse files Browse the repository at this point in the history
This fixes serialization order to match declaration order (which is
good), so we need to update some serialization test cases.
  • Loading branch information
emk committed Nov 10, 2016
1 parent d0fdcf9 commit 7cc3be9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ log = "0.3.6"
regex = "0.1.73"
serde = "0.8"
serde_derive = { version = "0.8", optional = true }
# See https://github.com/dtolnay/serde-yaml/issues/30 before upgrading to
# serde_yaml 0.5.x.
serde_yaml = "0.4.1"
serde_yaml = "0.5.0"
yaml-rust = "0.3.3"
url = "1.2.0"
void = "1.0.2"
4 changes: 2 additions & 2 deletions src/v2/build.in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ fn build_has_a_string_representation() {
#[test]
fn build_may_be_a_struct() {
let yaml = r#"---
"args":
"key": "value"
"context": "."
"dockerfile": "Dockerfile"
"args":
"key": "value"
"#;
assert_roundtrip!(Build, yaml);

Expand Down
2 changes: 1 addition & 1 deletion src/v2/extends.in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ impl Extends {
#[test]
fn extends_can_be_roundtripped() {
let yaml = r#"---
"file": "bar/docker-compose.yml"
"service": "foo"
"file": "bar/docker-compose.yml"
"#;
assert_roundtrip!(Extends, yaml);
}
4 changes: 2 additions & 2 deletions src/v2/file.in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ impl FromStr for File {
#[cfg_attr(feature="clippy", allow(blacklisted_name))]
fn file_can_be_converted_from_and_to_yaml() {
let yaml = r#"---
"version": "2"
"services":
"foo":
"build": "."
"version": "2"
"volumes":
"db":
"external": true
Expand All @@ -125,10 +125,10 @@ fn file_can_be_converted_from_and_to_yaml() {
#[test]
fn file_can_only_load_from_version_2() {
let yaml = r#"---
"version": "3"
"services":
"foo":
"build": "."
"version": "3"
"#;
assert!(serde_yaml::from_str::<File>(&yaml).is_err());
}

0 comments on commit 7cc3be9

Please sign in to comment.