Sha256: d3d50ab1c8193dc94188da44def27f905a20bc4e44e5339f52d00493f9b32ad3

Contents?: true

Size: 764 Bytes

Versions: 5

Compression:

Stored size: 764 Bytes

Contents

require 'rubygems'
require 'bundler/setup'
require 'minitest/autorun'
require 'turn'

require File.join(File.dirname(__FILE__), '..', 'lib', 'pretty_diff')

class MiniTest::Unit::TestCase
  include PrettyDiff::WordDiffFinder

  class FixtureNotFoundError < StandardError; end

  def new_diff(*args)
    PrettyDiff::Diff.new(*args)
  end

  def fixture(name)
    path = File.join(File.dirname(__FILE__), "fixtures", name)
    if File.exist?(path)
      File.read(path)
    else
      raise FixtureNotFoundError.new("Fixture at path '#{path}' was not found")
    end
  end

  def strip_word_indicators(text)
    text
    .gsub(WDIFF_INSERTED_START, '')
    .gsub(WDIFF_INSERTED_END, '')
    .gsub(WDIFF_DELETED_START, '')
    .gsub(WDIFF_DELETED_END, '')
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pretty_diff-2.1.4 test/helper.rb
pretty_diff-2.1.3 test/helper.rb
pretty_diff-2.1.2 test/helper.rb
pretty_diff-2.1.1 test/helper.rb
pretty_diff-2.1.0 test/helper.rb