Sha256: 767da06b1acb9cf7342e07b247c3ba0a90a421d68c624bfdc3133b0ef6eef2d4

Contents?: true

Size: 796 Bytes

Versions: 3

Compression:

Stored size: 796 Bytes

Contents

require 'rubygems'
require 'test/unit'
require 'flexmock/test_unit'
require 'documentalist'

def fixture_001
  File.join(File.dirname(__FILE__), "fixtures/fixture_001.odt")
end

def fixture_002
  File.join(File.dirname(__FILE__), "fixtures/fixture_002.html")
end

class Test::Unit::TestCase
  def assert_difference(code, difference = 0, message = nil)
    message = "Returned values were equal" unless message
    start_value = eval(code).to_i
    yield
    end_value = eval(code).to_i

    if difference
      assert_equal difference, end_value - start_value, message
    else
      assert((end_value - start_value) != 0, message)
    end
  end

  def assert_no_difference(code, message = "Returned values were different")
    assert_difference(code, 0, message) do
      yield
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
documentalist-0.1.4 test/test_helper.rb
documentalist-0.1.3 test/test_helper.rb
documentalist-0.1.2 test/test_helper.rb