Sha256: 170a63693300272ecff1367554f2a0f71b86201825091283ac64a6cede5c37a7

Contents?: true

Size: 990 Bytes

Versions: 2

Compression:

Stored size: 990 Bytes

Contents

require 'spec_helper'
require 'moblues/cli'

describe 'moblues' do
  subject { Moblues::CLI }
  let(:perform) { subject.start([command] + options) }

  describe 'generate' do
    let(:command) { 'generate' }
    let(:options) { %w{--model=spec/resources/Model.xcdatamodeld --human=spec/resources/tmp/human --machine=spec/resources/tmp/machine} }

    after do
      Fixtures.delete_tmp_files(machine_files + human_files.select { |f| !f.include?('Playlist') } )
    end

    it 'generates human and machine files' do
      perform

      (machine_files + human_files).each do |file|
        expect(Fixtures.read_file(Fixtures.generated_dir, file)).to eq(Fixtures.read_file(Fixtures.expected_dir, file))
      end
    end
  end

  def machine_files
    entities.map{|f| "machine/_#{f}" }.map{ |f| %W(#{f}.h #{f}.m) }.flatten
  end

  def human_files
    entities.map{|f| "human/#{f}" }.map{ |f| %W(#{f}.h #{f}.m) }.flatten
  end

  def entities
    %w{User Playable Track Playlist}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
moblues-0.1.0 spec/features/moblues_spec.rb
moblues-0.0.1 spec/features/moblues_spec.rb