use stern4rust::section::Section;
#[test]
fn blank_lines_between_entries_of_every_other_section_is_one() {
assert_eq!(Section::Constants.blank_lines_between_entries(), 1);
assert_eq!(Section::Helpers.blank_lines_between_entries(), 1);
assert_eq!(Section::Tests.blank_lines_between_entries(), 1);
}
#[test]
fn blank_lines_between_entries_of_imports_is_none() {
let expected = Section::Imports.blank_lines_between_entries();
assert_eq!(expected, 0);
}
#[test]
fn label_reads_as_the_thing_itself() {
assert_eq!(Section::Imports.label(), "import");
assert_eq!(Section::Constants.label(), "constant");
assert_eq!(Section::Helpers.label(), "helper");
assert_eq!(Section::Tests.label(), "test");
}
#[test]
fn ordering_places_constants_before_helpers() {
let constants = Section::Constants;
assert!(constants < Section::Helpers);
}
#[test]
fn ordering_places_imports_before_every_other_section() {
let imports = Section::Imports;
assert!(imports < Section::Constants);
assert!(imports < Section::Helpers);
assert!(imports < Section::Tests);
}
#[test]
fn ordering_places_tests_after_every_other_section() {
let tests = Section::Tests;
assert!(tests > Section::Imports);
assert!(tests > Section::Constants);
assert!(tests > Section::Helpers);
}