Cleaner output while running tests
This commit is contained in:
parent
144771a2c0
commit
bb9d8703f3
@ -92,7 +92,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn write_settings() {
|
fn write_settings() {
|
||||||
let s = settings::Settings::new();
|
let s = settings::Settings::new();
|
||||||
let path = std::path::Path::new("test.yaml");
|
let path = std::path::Path::new("settings.yaml");
|
||||||
let settings = r#"---
|
let settings = r#"---
|
||||||
version: "1"
|
version: "1"
|
||||||
categories: {}
|
categories: {}
|
||||||
@ -104,7 +104,7 @@ rules: []"#;
|
|||||||
#[test]
|
#[test]
|
||||||
fn read_settings() {
|
fn read_settings() {
|
||||||
let s1 = settings::Settings::new();
|
let s1 = settings::Settings::new();
|
||||||
let path = std::path::Path::new("test.yml");
|
let path = std::path::Path::new("settings.yml");
|
||||||
s1.export(&path).unwrap();
|
s1.export(&path).unwrap();
|
||||||
let s2 = settings::Settings::import(&path).unwrap();
|
let s2 = settings::Settings::import(&path).unwrap();
|
||||||
assert_eq!(s1, s2);
|
assert_eq!(s1, s2);
|
||||||
|
@ -274,13 +274,13 @@ impl Settings {
|
|||||||
/// let s = Settings::new();
|
/// let s = Settings::new();
|
||||||
///
|
///
|
||||||
/// // Export to JSON
|
/// // Export to JSON
|
||||||
/// let path_json = Path::new("./output.json");
|
/// let path_json = Path::new("settings.json");
|
||||||
/// s.export(&path_json).unwrap();
|
/// s.export(&path_json).unwrap();
|
||||||
///
|
///
|
||||||
/// // Export to Yaml, both ".yml" and ".yaml" work
|
/// // Export to Yaml, both ".yml" and ".yaml" work
|
||||||
/// let path_yaml = Path::new("./output.yaml");
|
/// let path_yaml = Path::new("settings.yaml");
|
||||||
/// s.export(&path_yaml).unwrap();
|
/// s.export(&path_yaml).unwrap();
|
||||||
/// let path_yml = Path::new("./output.yml");
|
/// let path_yml = Path::new("settings.yml");
|
||||||
/// s.export(&path_yml).unwrap();
|
/// s.export(&path_yml).unwrap();
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
|
Loading…
Reference in New Issue
Block a user