preaction / Statocles

Static website CMS
http://preaction.me/statocles
Other
84 stars 33 forks source link

Make tests work when !-t STDIN #561

Closed mohawk2 closed 6 years ago

preaction commented 6 years ago

This is very close to what I'm thinking of, but I was also thinking you could add the if ( !-t STDIN ) { ... } test in the read_stdin sub. That way for most tests there's no different code paths taken based on the external environment of the tests.

So, the consumer would do if ( my $content = read_stdin() ) { ... } and wouldn't have to check all the right things for STDIN (which, if I recall correctly, is both !-t and -z)

coveralls commented 6 years ago

Coverage Status

Coverage increased (+0.01%) to 91.873% when pulling b80cc8c4544e76e3c5d8f46172ed34654e5229f9 on mohawk2:test-stdin into 305b6f694f1ece6aa5d9a991eface2b54fbb3215 on preaction:master.