Sha256: f5fc34081ead137fac1d5afe9496caca5e85c15679350001c14d88fb5c6341b9

Contents?: true

Size: 816 Bytes

Versions: 10

Compression:

Stored size: 816 Bytes

Contents

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

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

    it 'should delegate name' do
      expect(proxy.name).to eq(intType.name)
    end

    it 'should delegate default_name' do
      expect(proxy.default_name).to eq(intType.default_name)
    end

    it 'should delegate hash' do
      expect(proxy.hash).to eq(intType.hash)
    end

    it 'should delegate ==' do
      expect(intType == proxy).to eq(true)
      expect(proxy == intType).to eq(true)
    end

    it 'should delegate dress' do
      expect(proxy.dress(12)).to eq(12)
    end

    it 'should delegate include?' do
      expect(proxy.include?(12)).to eq(true)
    end

    it 'should delegate to_s' do
      expect(proxy.to_s).to eq(intType.to_s)
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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