Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The best bet is to find the code that is printing that error, then you can figure out if there is a precise way of silencing that error.</p> <p>That error message has a unique misspelling (encountererd) that does not seem to occur (or ever have occurred) in the <a href="https://github.com/plataformatec/devise" rel="nofollow noreferrer">devise source</a>. Perhaps it is coming from your code or another gem? A quick github search didn't have any useful results.</p> <p><strong>Added</strong></p> <p>It appears that you didn't copy-and-paste the error exactly, so I was looking for a string that never occurs! This is the <a href="https://github.com/intridea/omniauth/blob/v1.1.4/lib/omniauth/strategy.rb#L462" rel="nofollow noreferrer">source of the error</a>. You should be able to set the OmniAuth logger to something else for the duration of the test. This is the same style as <code>silence</code> below:</p> <pre><code>def silence_omniauth previous_logger = OmniAuth.config.logger OmniAuth.config.logger = Logger.new("/dev/null") yield ensure OmniAuth.config.logger = previous_logger end </code></pre> <p><strong>Original</strong></p> <p>If you cannot find the source of the message, then there is always the nuclear option: completely disabling printing to the standard output streams during that test. This other <a href="https://stackoverflow.com/questions/4459330">SO question</a> has an example of how to do it, which I'll modify and reproduce here:</p> <pre><code>def silence previous_stdout, $stdout = $stdout, StringIO.new previous_stderr, $stderr = $stderr, StringIO.new yield ensure # Restore the previous values of stdout and stderr $stdout = previous_stdout $stderr = previous_stderr end # And in your test it 'does whatever' do silence { code.that_causes.the_warning } end </code></pre> <p>To reiterate, it is <strong>much</strong> better to find a narrower solution. Silencing stdout / stderr will undoubtedly confuse someone when they go to print out debugging information during the test and see nothing. I say this as it happened to me just this last week. :-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload