fix: matchers in Pact file can have a different order on OSX
@@ -1665,66 +1665,66 @@ fn write_pact_v3_test_with_matchers() {
fs::remove_dir_all(dir.parent().unwrap()).unwrap_or(());
expect!(result).to(be_ok());
- expect!(pact_file).to(be_equal_to(format!(r#"{{
- "consumer": {{
+ expect!(pact_file.parse::<Value>().unwrap()).to(be_equal_to(json!({
+ "consumer": {
"name": "write_pact_test_consumer_v3"
- }},
+ },
"interactions": [
- {{
+ {
"description": "Test Interaction",
"providerStates": [
- {{
+ {
"name": "Good state to be in"
- }}
+ }
],
- "request": {{
- "matchingRules": {{
- "body": {{
- "$": {{
+ "request": {
+ "matchingRules": {
+ "body": {
+ "$": {
"combine": "AND",
"matchers": [
- {{
+ {
"match": "type"
- }}
+ }
]
- }}
- }},
- "header": {{
- "HEADER_A": {{
+ }
+ },
+ "header": {
+ "HEADER_A": {
"combine": "AND",
"matchers": [
- {{
+ {
"match": "include",
"value": "ValA"
- }},
- {{
+ },
+ {
"match": "include",
"value": "ValB"
- }}
+ }
]
- }}
- }}
- }},
+ }
+ }
+ },
"method": "GET",
"path": "/"
- }},
- "response": {{
+ },
+ "response": {
"status": 200
- }}
- }}
+ }
+ }
],
- "metadata": {{
- "pactRust": {{
- "version": "{}"
- }},
- "pactSpecification": {{
+ "metadata": {
+ "pactRust": {
+ "version": super::PACT_RUST_VERSION
+ },
+ "pactSpecification": {
"version": "3.0.0"
- }}
- }},
- "provider": {{
+ }
+ },
+ "provider": {
"name": "write_pact_test_provider_v3"
- }}
-}}"#, super::PACT_RUST_VERSION.unwrap())));
+ }
+ })));
}
#[test]
