Sha256: 7dc1d65fd08dd82d8af5a82ccf13c187001d56a9281179a4e27e918f9c63b1e5

Contents?: true

Size: 1.09 KB

Versions: 29

Compression:

Stored size: 1.09 KB

Contents

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

describe Lolita::Configuration::Base do
#    before(:each) do
#      @base = Lolita::Configuration::Base.new
#    end

  it "should define configuration without block" do
    Post.lolita.should_not be_nil
  end

  it "should define configuration with block" do
    Profile.lolita.should_not be_nil
  end

  it "should not initialize instance methods for configuration without calling them" do
    Profile.lolita.list.to_s.should match(/Lolita::LazyLoader/)
    Post.lolita.list.to_s.should match(/Lolita::LazyLoader/)
  end

  it "should return real object when calling it" do
    define_config do
      list
    end
    Post.lolita.list.class.to_s.should == "Lolita::Configuration::List"
  end

  it "should return tabs" do
    define_config
    Post.lolita.tabs.class.should == Lolita::Configuration::Tabs
  end

  it "should allow add tabs" do
    define_config do
      tab(:content)
    end
    Post.lolita.tabs.size.should == 1
  end
  
  def define_config &block
    Post.lolita=Lolita::Configuration::Base.new(Post,&block)
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
lolita-3.2.0.rc.7 spec/configuration/base_spec.rb
lolita-3.1.18 spec/configuration/base_spec.rb
lolita-3.2.0.rc.6 spec/configuration/base_spec.rb
lolita-3.2.0.rc.5 spec/configuration/base_spec.rb
lolita-3.2.0.rc.4 spec/configuration/base_spec.rb
lolita-3.2.0.rc.3 spec/configuration/base_spec.rb
lolita-3.2.0.rc2 spec/configuration/base_spec.rb
lolita-3.2.0.rc1 spec/configuration/base_spec.rb
lolita-3.1.17 spec/configuration/base_spec.rb
lolita-3.1.16 spec/configuration/base_spec.rb
lolita-3.1.15 spec/configuration/base_spec.rb
lolita-3.1.14 spec/configuration/base_spec.rb
lolita-3.1.13 spec/configuration/base_spec.rb
lolita-3.1.12 spec/configuration/base_spec.rb
lolita-3.1.11 spec/configuration/base_spec.rb
lolita-3.1.9 spec/configuration/base_spec.rb
lolita-3.1.8 spec/configuration/base_spec.rb
lolita-3.1.7 spec/configuration/base_spec.rb
lolita-3.1.6 spec/configuration/base_spec.rb
lolita-3.1.5 spec/configuration/base_spec.rb