Forum: RSpec Weird progress bar failure on unrelated spec

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ashley M. (Guest)
on 2009-01-16 22:35
(Received via mailing list)
Hi

Before I try to recreate this, does anyone know what generally causes
this in a progress spec run?

............................/opt/local/lib/ruby/gems/1.8/gems/
rspec-1.1.12/lib/spec/runner/formatter/progress_bar_formatter.rb:25:in
`flush': Bad file descriptor (Errno::EBADF)
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
formatter/progress_bar_formatter.rb:25:in `start_dump'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
reporter.rb:57:in `dump'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
reporter.rb:57:in `each'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
reporter.rb:57:in `dump'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
example_group_runner.rb:38:in `finish'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
example_group_runner.rb:27:in `run'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
options.rb:111:in `run_examples'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/
runner.rb:78:in `run'
  from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/
runner.rb:48:in `register_at_exit_hook'
  from spec/followme/content/bbc_page_spec.rb:106

(Line 106 reads 'describe LowGraphicsBBCPage do')

The problem is that the file spec/followme/content/bbc_page_spec.rb is
NOT the source of the error, it's actually caused by this in another
file:

     class RssReader
       class RssReaderError < StandardError; end

       def initialize(uri)
         @uri = uri
       end

       def rss
         rss =
           begin
             ::RSS::Parser.parse(@uri.read, false)
           rescue OpenURI::HTTPError, Errno::ECONNREFUSED => error
             # For some bizarre reason this next line breaks breaks
the specs
             # FollowMe.logger.warn("Error reading RSS")
             FollowMe.logger.warn(error)
             raise RssReaderError.new(error.message)
           end
         raise RssReaderError.new("No RSS in feed") unless rss
         rss
       end
     end

FollowMe.logger is a mock during the specs of RssReader, but RssReader
is not referenced in spec/followme/content/bbc_page_spec.rb at all.
Stranger, the second of the two log calls does not cause an error.

Anyone got any pointers that could help me figure this one out?

Cheers
Ashley

--
http://www.patchspace.co.uk/
http://aviewfromafar.net/
http://twitter.com/ashleymoran
Ashley M. (Guest)
on 2009-01-17 00:59
(Received via mailing list)
Just as an addendum to that, it also exhibits freezing behaviour on
one of the specs (presumably the same) with just the one line in
place.  (It just hangs indefinitely during the progress output.)

Don't expect anyone will be able to figure this out without seeing all
the code, so I'm hoping someone can tell me where to look...

On 16 Jan 2009, at 20:20, Ashley M. wrote:

>   from /opt/local/lib/ruby/gems/1.8/gems/rspec-1.1.12/lib/spec/runner/
> options.rb:111:in `run_examples'
> another file:
>          begin
>      end
> Ashley
>
> --
> http://www.patchspace.co.uk/
> http://aviewfromafar.net/
> http://twitter.com/ashleymoran
>
>
>

--
http://www.patchspace.co.uk/
http://aviewfromafar.net/
http://twitter.com/ashleymoran
This topic is locked and can not be replied to.