Sha256: 244a1e876e2faef64515d534d65b5b5d6a2e4f75e81485220521d2641deb4c4f

Contents?: true

Size: 951 Bytes

Versions: 1

Compression:

Stored size: 951 Bytes

Contents

require 'spec_helper'


module Kangaroo
  describe 'Lazy Loading' do
    before :all do
      config = Kangaroo::Util::Configuration.new 'spec/test_env/test.yml'
      config.login
  
      Kangaroo::Util::Loader.new('res.partner', config.database).load!
    end
    
    it 'should raise error if trying to access constant without corresponding OpenERP Model' do
      lambda {
        Oo::Abcd
      }.should raise_error
      
      lambda {
        Oo::Res::Bcde
      }.should raise_error
    end
    
    it 'should lazy load additional models in an OpenERP namespace' do
      lambda {
        Oo::Res::Country
      }.should_not raise_error
    end
    
    it 'should create namespace modules on demand' do
      lambda {
        Oo::Product
      }.should_not raise_error
    end
    
    it 'should lazy load missing models in other namespaces' do
      lambda {
        Oo::Product::Product
      }.should_not raise_error
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kangaroo-0.0.3 spec/functional/lazy_loading_spec.rb