Sha256: 2326fe24d21bbe3246aeeb8b305e0a60092260c13f06bf81554e3a0ab6697281

Contents?: true

Size: 517 Bytes

Versions: 18

Compression:

Stored size: 517 Bytes

Contents

# frozen_string_literal: true
# encoding: utf-8

require 'spec_helper'

describe Mongoid::Document do
  context 'when including class uses delegate' do
    let(:patient) do
      DelegatingPatient.new(
        email: Email.new(address: 'test@example.com'),
      )
    end

    it 'works for instance level delegation' do
      patient.address.should == 'test@example.com'
    end

    it 'works for class level delegation' do
      DelegatingPatient.default_client.should be Mongoid.default_client
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/mongoid-7.1.7/spec/integration/document_spec.rb
mongoid-7.0.13 spec/integration/document_spec.rb
mongoid-7.2.1 spec/integration/document_spec.rb
mongoid-7.1.7 spec/integration/document_spec.rb
mongoid-7.0.12 spec/integration/document_spec.rb
mongoid-7.2.0 spec/integration/document_spec.rb
mongoid-7.1.6 spec/integration/document_spec.rb
mongoid-6.4.8 spec/integration/document_spec.rb
mongoid-7.0.11 spec/integration/document_spec.rb
mongoid-7.1.5 spec/integration/document_spec.rb
mongoid-7.2.0.rc1 spec/integration/document_spec.rb
mongoid-7.1.4 spec/integration/document_spec.rb
mongoid-7.0.10 spec/integration/document_spec.rb
mongoid-6.4.7 spec/integration/document_spec.rb
mongoid-6.4.5 spec/integration/document_spec.rb
mongoid-7.0.8 spec/integration/document_spec.rb
mongoid-7.1.2 spec/integration/document_spec.rb
mongoid-7.1.1 spec/integration/document_spec.rb