Sha256: b5509d7b21d4e1eff108f688bc5d9251cb40de61482e56da2d4f5f251deaacf8

Contents?: true

Size: 878 Bytes

Versions: 30

Compression:

Stored size: 878 Bytes

Contents

# -*- coding: utf-8 -*-
require 'rubygems'
require 'test/unit'

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'writeexcel'

class Test::Unit::TestCase
  ###############################################################################
  #
  # Unpack the binary data into a format suitable for printing in tests.
  #
  def unpack_record(data)
    data.unpack('C*').map! {|c| sprintf("%02X", c) }.join(' ')
  end

  # expected : existing file path
  # target   : io (ex) string io object where stored data.
  def compare_file(expected, target)
    # target is StringIO object.
    result =
      ruby_18 { target.string } ||
      ruby_19 { target.string.force_encoding('BINARY') }
    assert_equal(
      File.binread(expected),
      result,
      "#{File.basename(expected)} doesn't match."
    )
  end
end

Version data entries

30 entries across 30 versions & 3 rubygems

Version Path
writeexcel-1.0.1 test/helper.rb
writeexcel-1.0.0 test/helper.rb
writeexcel-0.6.19 test/helper.rb
writeexcel-0.6.18 test/helper.rb
writeexcel-0.6.17 test/helper.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.16/test/helper.rb
writeexcel-0.6.16 test/helper.rb
writeexcel-0.6.15 test/helper.rb
writeexcel-0.6.14 test/helper.rb
sunrise-cms-0.3.3 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/test/helper.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/test/helper.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/test/helper.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/test/helper.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/writeexcel-0.6.13/test/helper.rb
writeexcel-0.6.13 test/helper.rb
ricardoo27-writeexcel-0.6.12.2 test/helper.rb
ricardoo27-writeexcel-0.6.12.1 test/helper.rb
writeexcel-0.6.12 test/helper.rb
writeexcel-0.6.11 test/helper.rb
writeexcel-0.6.10 test/helper.rb