Skip to content
  • John Hawthorn's avatar
    79953c47
    Allow tests to run without a TTY · 79953c47
    John Hawthorn authored
    We had two tests which assigned IO.console.winsize (to ensure output was
    consistent), however it's possible for IO.console to be nil.
    
    This commit makes these tests stub IO.console_size directly (the method
    we actually call, we shouldn't have been relying on that calling
    IO.console.winsize anyways) or passes the width when initializing the
    class.
    
    This allows tests to run without a TTY. This can be tested with ex.
    
        ssh localhost "cd src/rails/actionpack && bundle exec rake"
    
    or
    
        (setsid bundle exec rake) </dev/null |& cat
    79953c47
    Allow tests to run without a TTY
    John Hawthorn authored
    We had two tests which assigned IO.console.winsize (to ensure output was
    consistent), however it's possible for IO.console to be nil.
    
    This commit makes these tests stub IO.console_size directly (the method
    we actually call, we shouldn't have been relying on that calling
    IO.console.winsize anyways) or passes the width when initializing the
    class.
    
    This allows tests to run without a TTY. This can be tested with ex.
    
        ssh localhost "cd src/rails/actionpack && bundle exec rake"
    
    or
    
        (setsid bundle exec rake) </dev/null |& cat
Loading