rspec - Specific test behaviour for ruby gem -- mocking sleep -
so made ruby gem makes use of sleep
function. using gem in applications causes sleep function called in tests.
what preferred approach dealing this? right now, i'm mocking out sleep in application there way disable sleeping test environment in actual gem code? don't think can use rack_env
since gem not specific web app.
thank you
as difficult know whether in test-like environment, solution not try: provide method allows users of gem indicate sleeps should not occur.
you try , autodetect whether should default not sleeping (eg if looks rails loaded , rails.env.test?
true) while still allowing users of gem explicitly activate no sleep mode cases can't autodetect.
Comments
Post a Comment