Sha256: fbbe63fc13eb552dcf6ec894b56074ecd4ad9f08fb06dac4a97ab303de9be5c0

Contents?: true

Size: 1.1 KB

Versions: 28

Compression:

Stored size: 1.1 KB

Contents

require '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

28 entries across 28 versions & 1 rubygems

Version Path
lolita-4.0.11 spec/extensions/extensions_spec.rb
lolita-4.2.0 spec/extensions/extensions_spec.rb
lolita-4.0.10 spec/extensions/extensions_spec.rb
lolita-4.0.9 spec/extensions/extensions_spec.rb
lolita-4.0.8 spec/extensions/extensions_spec.rb
lolita-4.0.7 spec/extensions/extensions_spec.rb
lolita-4.0.6 spec/extensions/extensions_spec.rb
lolita-4.0.5 spec/extensions/extensions_spec.rb
lolita-4.0.4 spec/extensions/extensions_spec.rb
lolita-4.0.3 spec/extensions/extensions_spec.rb
lolita-4.0.2 spec/extensions/extensions_spec.rb
lolita-4.0.1 spec/extensions/extensions_spec.rb
lolita-4.0.0 spec/extensions/extensions_spec.rb
lolita-3.4.3 spec/extensions/extensions_spec.rb
lolita-3.4.2 spec/extensions/extensions_spec.rb
lolita-3.4.1 spec/extensions/extensions_spec.rb
lolita-3.4.0 spec/extensions/extensions_spec.rb
lolita-3.3.9 spec/extensions/extensions_spec.rb
lolita-3.3.8 spec/extensions/extensions_spec.rb
lolita-3.3.7 spec/extensions/extensions_spec.rb