summaryrefslogtreecommitdiffstats
path: root/tests/pager.rs
blob: b9ca62f845b5f4f2cc25ae5bf5dbfd2de4a2166d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
extern crate pager;

use std::env;

use pager::Pager;

#[test]
fn nopager() {
    env::set_var("NOPAGER", "");
    let mut pager = Pager::new();
    pager.setup();
    env::remove_var("NOPAGER");
    assert!(!pager.is_on());
}

#[test]
fn notty() {
    let mut pager = Pager::new().skip_on_notty();
    pager.setup();
    assert!(!pager.is_on());
}