Sha256: 973eb17006b9c4c1b0cdf10b87bd8f2c14445bd3bd1abe17a56c6b771910dc43

Contents?: true

Size: 905 Bytes

Versions: 3

Compression:

Stored size: 905 Bytes

Contents

require 'spec_helper'

describe Moblues::Generator::Base::Model do
  describe '#generate' do
    subject { described_class.new(human: human, machine: machine, human_dir: human_dir, machine_dir: machine_dir) }

    let(:entities) { [build(:entity)] }
    let(:entity) { entities.first }
    let(:human_dir) { 'human/dir'}
    let(:machine_dir) { 'machine/dir'}

    let(:human) { double(Moblues::Generator::Objc::Human) }
    let(:machine) { double(Moblues::Generator::Objc::Machine) }

    before do
      allow(Moblues::Generator::Objc::Human).to receive(:new) { human }
      allow(Moblues::Generator::Objc::Machine).to receive(:new) { machine }
    end

    it 'generates the human and machine files' do
      expect(human).to receive(:generate).with(human_dir, entity).once
      expect(machine).to receive(:generate).with(machine_dir, entity).once

      subject.generate(entities)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
moblues-0.4.0 spec/lib/moblues/generator/base/model_spec.rb
moblues-0.3.0 spec/lib/moblues/generator/base/model_spec.rb
moblues-0.2.0 spec/lib/moblues/generator/base/model_spec.rb