Sha256: dea9c00a02f79892ffe142041521fa49efbb40389a2c5883e22ad6c4b31cd07b

Contents?: true

Size: 945 Bytes

Versions: 6

Compression:

Stored size: 945 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Arstotzka::PostProcessor do
  describe 'yard' do
    subject(:processor) { described_class.new(options) }

    let(:company) { Company.new }

    let(:options) do
      {
        after:    :create_employes,
        flatten:  true,
        instance: company
      }
    end

    let(:value) do
      [
        [
          { name: 'Bob',   age: 21 },
          { name: 'Rose',  age: 19 }
        ], [
          { name: 'Klara', age: 18 },
          { name: 'Al',    age: 15 }
        ]
      ]
    end

    let(:expected) do
      [
        Employe.new(name: 'Bob',   age: 21, company: company),
        Employe.new(name: 'Rose',  age: 19, company: company),
        Employe.new(name: 'Klara', age: 18, company: company)
      ]
    end

    describe 'Simple usage' do
      it 'maps and filter' do
        expect(processor.process(value)).to eq(expected)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
arstotzka-1.6.2 spec/integration/yard/arstotzka/post_processor_spec.rb
arstotzka-1.6.1 spec/integration/yard/arstotzka/post_processor_spec.rb
arstotzka-1.6.0 spec/integration/yard/arstotzka/post_processor_spec.rb
arstotzka-1.5.0 spec/integration/yard/arstotzka/post_processor_spec.rb
arstotzka-1.4.4 spec/integration/yard/arstotzka/post_processor_spec.rb
arstotzka-1.4.3 spec/integration/yard/arstotzka/post_processor_spec.rb