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