Sha256: 2fd7a5b58e4d188ab174aaecb9404f92b26d5a7841906f73cafab36068816738

Contents?: true

Size: 1.01 KB

Versions: 14

Compression:

Stored size: 1.01 KB

Contents

require 'spec_helper'
require 'sandthorn/bounded_context'

module Sandthorn
  describe BoundedContext do
    it 'should respond to `aggregate_types`' do
      expect(BoundedContext).to respond_to(:aggregate_types)
    end
  end

  describe "::aggregate_types" do
    module TestModule
      include Sandthorn::BoundedContext
      class AnAggregate 
        include Sandthorn::AggregateRoot
      end

      class NotAnAggregate
      end

      module Deep
        class DeepAggregate
          include Sandthorn::AggregateRoot
        end
      end
    end

    it "aggregate_types should include AnAggregate" do
      expect(TestModule.aggregate_types).to include(TestModule::AnAggregate)
    end

    it "aggregate_types should not include NotAnAggregate" do
      expect(TestModule.aggregate_types).not_to include(TestModule::NotAnAggregate)
    end

    it "aggregate_types should include DeepAnAggregate in a nested Module" do
      expect(TestModule.aggregate_types).to include(TestModule::Deep::DeepAggregate)
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sandthorn-1.3.0 spec/bounded_context_spec.rb
sandthorn-1.2.0 spec/bounded_context_spec.rb
sandthorn-1.1.0 spec/bounded_context_spec.rb
sandthorn-1.0.0 spec/bounded_context_spec.rb
sandthorn-0.13.0 spec/bounded_context_spec.rb
sandthorn-0.12.0 spec/bounded_context_spec.rb
sandthorn-0.11.0 spec/bounded_context_spec.rb
sandthorn-0.10.3 spec/bounded_context_spec.rb
sandthorn-0.10.2 spec/bounded_context_spec.rb
sandthorn-0.10.1 spec/bounded_context_spec.rb
sandthorn-0.10.0 spec/bounded_context_spec.rb
sandthorn-0.9.2 spec/bounded_context_spec.rb
sandthorn-0.9.1 spec/bounded_context_spec.rb
sandthorn-0.9.0 spec/bounded_context_spec.rb