Sha256: ba35735c1de77c5cf1cb4f99229194bfcdb52b82741dba66c45f363f69cc0eaa

Contents?: true

Size: 945 Bytes

Versions: 18

Compression:

Stored size: 945 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/fs/temp'
require 'ehbrs/tools/runner'
require 'ehbrs/tools/runner/vg/ips'

RSpec.describe ::Ehbrs::Tools::Runner::Vg::Ips do
  let(:source_dir) { ::Pathname.new('ips_spec_files').expand_path __dir__ }
  let(:source_file) { source_dir / 'source.rom' }
  let(:patches) { 2.times.map { |i| source_dir / "patch_#{i}.ips" } }

  describe '#run' do
    let(:output_file) { ::EacRubyUtils::Fs::Temp.file }
    let(:expected_file) { source_dir / 'expected.rom' }
    let(:run_argv) do
      ['vg', 'ips', '--output-file', output_file.to_path, source_file.to_path] +
        patches.map(&:to_path)
    end

    before do
      ::Ehbrs::Tools::Runner.run(argv: run_argv)
    end

    after do
      output_file.unlink if output_file.exist?
    end

    it { expect(output_file).to exist }
    it { expect(::FileUtils.compare_file(output_file.to_path, expected_file.to_path)).to be_truthy }
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
ehbrs-tools-0.37.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.36.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.35.1 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.35.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.34.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.33.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.32.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.31.1 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.31.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.30.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.29.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.28.3 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.28.2 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.28.1 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.28.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.27.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.26.0 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb
ehbrs-tools-0.25.1 spec/lib/ehbrs/tools/runner/vg/ips_spec.rb