Sha256: 1de7a5c5a4155d3a0fd1bd8a6de4400a61c251e487d7c6eba549e1f1e4fbb9a5

Contents?: true

Size: 459 Bytes

Versions: 2

Compression:

Stored size: 459 Bytes

Contents

require 'diff_matcher'

module DiffMatcher
  module CLI
    def self.diff(expected, actual, opts={})
      # TODO maybe parse opts from command line instead of ENV vars...
      diff_opts = {
        color_enabled: true,
        ignore_additional: ENV['IGNORE_ADDITIONAL'],
        quiet: !ENV['VERBOSE']
      }

      if (diff_string = DiffMatcher.difference(expected, actual, diff_opts))
        puts diff_string
        exit 1
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
diff_matcher-2.9.0 lib/diff_matcher/cli.rb
diff_matcher-2.8.1 lib/diff_matcher/cli.rb