Sha256: a3662c006496f8cca99894a04fd9ef30b2c2959e1c2eeb90f96d2ac4af632955

Contents?: true

Size: 620 Bytes

Versions: 8

Compression:

Stored size: 620 Bytes

Contents

# frozen_string_literal: true

class Case
  def close(uniques)
    # Invoked from check_cases!

    fails = 0
    @uniques.each do |key|
      next unless uniques[key].include?(id) && uniques[key].count > 1

      fails += 1
      log_unique_message(key, uniques[key])
    end
    @report.tail[:unique_fault] = fails
    @report.close
  end

  private

  def log_unique_message(key, value)
    log("UNIQUE:", :error)
    begin
      log("   ├── Value     => #{key}", :error)
      log("   └── Conflicts => #{value}", :error)
    rescue => e
      log(key, :error)
      log(e.to_s, :error)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
teuton-2.9.2 lib/teuton/case/close.rb
teuton-2.9.1 lib/teuton/case/close.rb
teuton-2.9.0 lib/teuton/case/close.rb
teuton-2.8.0 lib/teuton/case/close.rb
teuton-2.7.3 lib/teuton/case/close.rb
teuton-2.7.2 lib/teuton/case/close.rb
teuton-2.7.1 lib/teuton/case/close.rb
teuton-2.7.0 lib/teuton/case/close.rb