Sha256: 3271034359a93774f873489e2ca32254ddf98e437f2698cf0c5b5b8e2b0fc69d

Contents?: true

Size: 845 Bytes

Versions: 6

Compression:

Stored size: 845 Bytes

Contents

# frozen_string_literal: true

#
# Copyright (c) 2018-present, Blue Marble Payroll, LLC
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#

require './spec/spec_helper'

describe ::Differential do
  it 'should calculate a report' do
    dataset_a = [
      { name: 'Matt', minutes: 100, transport: 'Bike' }
    ]

    dataset_b = [
      { name: 'Matt', minutes: 20, transport: 'Car' }
    ]

    reader_config = {
      record_id_key:  :name,
      value_key:      :minutes,
      group_id_key:   :transport
    }

    report = ::Differential.calculate(dataset_a:      dataset_a,
                                      dataset_b:      dataset_b,
                                      reader_config:  reader_config)

    expect(report.groups.length).to eq(2)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
differential-1.0.6 spec/differential/differential_spec.rb
differential-1.0.5 spec/differential/differential_spec.rb
differential-1.0.4 spec/differential/differential_spec.rb
differential-1.0.3 spec/differential/differential_spec.rb
differential-1.0.2 spec/differential/differential_spec.rb
differential-1.0.1 spec/differential/differential_spec.rb