grin/config/tests/config.rs
Ivan Sorokin 5c029e3f87 Make grin.toml config optional (#1278)
* Make grin.toml config optional. Mirror exisiting config parameters in grin.toml to source code, so binary can run without a config file. Add test for it.
* fixup! Make grin.toml config optional
2018-07-29 17:48:24 -07:00

20 lines
464 B
Rust

#[macro_use]
extern crate pretty_assertions;
extern crate grin_config as config;
use config::GlobalConfig;
#[test]
fn file_config_equal_to_defaults() {
let x = true;
let global_config_without_file = GlobalConfig::default();
let global_config_with_file = GlobalConfig::new(Some("../grin.toml")).unwrap_or_else(|e| {
panic!("Error parsing config file: {}", e);
});
assert_eq!(
global_config_without_file.members,
global_config_with_file.members
);
}