Sha256: 8e3e58280d873d77323d17087b1c6d5ddad01455dee75fa224933d8401bea2c1

Contents?: true

Size: 900 Bytes

Versions: 1

Compression:

Stored size: 900 Bytes

Contents

require "spec_helper"
require "schizo/facade"

module Schizo
  module Facade

    describe ClassBuilder do

      let(:base) do
        Class.new do
          def self.name; "Foo"; end
        end
      end

      let(:role) do
        Module.new do
          extend Role
          extended do
            @test_var = 1
          end
        end
      end

      let(:builder) do
        ClassBuilder.new(base, role)
      end

      context "#initialize" do

        it "sets base and role" do
          builder.base.should == base
          builder.role.should == role
        end

      end

      context "#product" do

        it "returns a facade class" do
          builder.product.tap do |facade|
            facade.should be_a(Class)
            facade.ancestors.should include(base)
            facade.ancestors.should include(Base)
          end
        end

      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
schizo-0.1.1 spec/facade/class_builder_spec.rb