added test for descriptions="off" attribute

This commit is contained in:
p0lunin 2020-07-04 10:44:42 +03:00
parent 96a92b6ec2
commit 58cb5ad152
2 changed files with 17 additions and 1 deletions

View file

@ -45,7 +45,7 @@ futures = "0.3.1"
pin-project = "0.4.6"
serde_with_macros = "1.0.1"
teloxide-macros = "0.3.0"
teloxide-macros = { git = "http://github.com/teloxide/teloxide-macros", branch = "dev" }
[dev-dependencies]
smart-default = "0.6.0"

View file

@ -171,3 +171,19 @@ fn parse_named_fields() {
DefaultCommands::parse("/start 10 hello", "").unwrap()
);
}
#[test]
fn descriptions_off() {
#[command(rename = "lowercase")]
#[derive(BotCommand, Debug, PartialEq)]
enum DefaultCommands {
#[command(description = "off")]
Start,
Help,
}
assert_eq!(
DefaultCommands::descriptions(),
"/help\n".to_owned()
);
}