Sha256: db469665fbad3e55bf34f0b2464952b64ff2b09f119f6bfa9c5b0bae0edee3ea

Contents?: true

Size: 1.15 KB

Versions: 8

Compression:

Stored size: 1.15 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../simple_spec_helper')

class WithLolitaExtensions
  include Lolita::Extensions
end

module Lolita::Extensions::Test
  class Proxy
    def initialize *args
    end
  end
end

describe Lolita::Extensions do
  let(:test_class){ WithLolitaExtensions.new }
  let(:object){
    klass = Object.new
    klass.class_eval{include Lolita::Extensions}
    klass
  }
  
  it "should load all extensions proxies" do
    Lolita::Extensions.add(:test)
    test_class.load_extensions_proxies(object)
    test_class.test_proxy.should be_a(Lolita::Extensions::Test::Proxy)
  end
  
  context "default extensions" do
    it "should have default extensions proxies" do
      test_class.load_extensions_proxies(object)
      Lolita::Extensions::EXTENSIONS.each do |name|
        test_class.send(:"#{name}_proxy").should be_a("Lolita::Extensions::#{name.to_s.camelize}::Proxy".constantize)
      end
    end
  end

  context "default configuration" do

    it "should have authentication adapter" do
      test_class.load_extensions_proxies(object)
      test_class.authentication_proxy.respond_to?(:adapter).should be_true
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lolita-3.2.0.rc.17 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.16 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.14 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.13 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.12 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.11 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.10 spec/extensions/extensions_spec.rb
lolita-3.2.0.rc.9 spec/extensions/extensions_spec.rb