Sha256: 5fd9f8185c5ff51eb9bd41450be15edbe95ab013820f129e6171a276cfcc41ff

Contents?: true

Size: 569 Bytes

Versions: 10

Compression:

Stored size: 569 Bytes

Contents

require 'spec_helper'
module Finitio
  describe ProxyType, "delegation pattern" do

    let(:proxy){ ProxyType.new('Int') }

    subject{ proxy.resolve(system) }

    context 'when type exists' do
      let(:system){ {'Int' => intType} }

      it 'resolves fine' do
        subject
        expect(proxy.target).to eq(intType)
      end
    end

    context 'when type does not exist' do
      let(:system){ {} }

      it 'raises an error' do
        expect{
          subject
        }.to raise_error(Finitio::Error, "No such type `Int`")
      end
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
finitio-0.7.0 spec/type/proxy_type/test_resolve.rb
finitio-0.7.0.pre.rc4 spec/type/proxy_type/test_resolve.rb
finitio-0.7.0.pre.rc3 spec/type/proxy_type/test_resolve.rb
finitio-0.7.0.pre.rc2 spec/type/proxy_type/test_resolve.rb
finitio-0.7.0.pre.rc1 spec/type/proxy_type/test_resolve.rb
finitio-0.6.1 spec/type/proxy_type/test_resolve.rb
finitio-0.6.0 spec/type/proxy_type/test_resolve.rb
finitio-0.5.2 spec/type/proxy_type/test_resolve.rb
finitio-0.5.1 spec/type/proxy_type/test_resolve.rb
finitio-0.5.0 spec/type/proxy_type/test_resolve.rb