Sha256: 785b3459eb0213d0fb60f508991596f8b01752836e4d4ce3d0532820140784fe

Contents?: true

Size: 393 Bytes

Versions: 7

Compression:

Stored size: 393 Bytes

Contents

# frozen_string_literal: true

module FixturesHelper
  def load_diff(file_path, fixture_name)
    raw_diff = load_fixture(fixture_name + '.diff')
    return unless raw_diff

    double(
      patch: raw_diff,
      path: file_path
    )
  end

  def load_fixture(file_name)
    file = "#{File.dirname(__FILE__)}/fixtures/#{file_name}"
    return File.read(file) if File.exist?(file)
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
danger-wcc-0.1.4 spec/fixtures_helper.rb
danger-wcc-0.1.3 spec/fixtures_helper.rb
danger-wcc-0.1.2 spec/fixtures_helper.rb
danger-wcc-0.1.1 spec/fixtures_helper.rb
danger-wcc-0.1.0 spec/fixtures_helper.rb
danger-wcc-0.0.6 spec/fixtures_helper.rb
danger-wcc-0.0.5 spec/fixtures_helper.rb