Sha256: b2d891ef675fcada56a319c566488ff263ad729efd7b70d4eb81cddb34a2cb03

Contents?: true

Size: 891 Bytes

Versions: 5

Compression:

Stored size: 891 Bytes

Contents

require 'spec_helper'
require 'moblues/utils/model_resolver'

module Moblues
  module Utils
    describe ModelResolver do
      describe '#resolve_model' do
        context 'when model is nil' do
          it 'raises an ArgumentError' do
            expect { subject.resolve_model(nil) }.to raise_exception(ArgumentError)
          end
        end

        context 'when the model does not exist' do
          it 'raises an exception' do
            expect { subject.resolve_model('this/does/not/exist') }.to raise_exception(ArgumentError, 'this/does/not/exist not found')
          end
        end

        context 'when the model exists' do
          it 'returns the path to the Model contents' do
            expect(subject.resolve_model(Fixtures.xcdatamodeld)).to eq('spec/resources/Model.xcdatamodeld/Model 2.xcdatamodel/contents')
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
moblues-0.4.0 spec/lib/moblues/utils/model_resolver_spec.rb
moblues-0.3.0 spec/lib/moblues/utils/model_resolver_spec.rb
moblues-0.2.0 spec/lib/moblues/utils/model_resolver_spec.rb
moblues-0.1.0 spec/lib/moblues/utils/model_resolver_spec.rb
moblues-0.0.1 spec/moblues/utils/model_resolver_spec.rb