test/test_roo.rb
# call a block of code for each spreadsheet type
# and yield a reference to the roo object
call a block of code for each spreadsheet type
and yield a reference to the roo object
call a block of code for each spreadsheet type and yield a reference to the roo object
def with_each_spreadsheet(options)
    if options[:format]
      formats = Array(options[:format])
      invalid_formats = formats - FORMATS
      unless invalid_formats.empty?
        raise "invalid spreadsheet types: #{invalid_formats.join(', ')}"
      end
    else
      formats = FORMATS
    end
    formats.each do |format|
      begin
        yield Roo::Spreadsheet.open(File.join(TESTDIR,
          fixture_filename(options[:name], format)))
      rescue => e
        raise e, "#{e.message} for #{format}", e.backtrace
      end
    end
  end
def with_each_spreadsheet ( options ) if options [ :format ] formats = Array ( options [ :format ] ) invalid_formats = formats - FORMATS unless invalid_formats . empty? raise "invalid spreadsheet types: #{invalid_formats.join(', ')}" end else formats = FORMATS end formats . each do | format | begin yield Roo :: Spreadsheet . open ( File . join ( TESTDIR , fixture_filename ( options [ :name ] , format ) ) ) rescue => e raise e , "#{e.message} for #{format}" , e . backtrace end end end
call a block of code for each spreadsheet type
and yield a reference to the roo object
call a block of code for each spreadsheet type and yield a reference to the roo object
options
<not_specific>