Sha256: 434f4bdcc7fdac8ffbd61680b5f5b006ad8ab1eeded53ebf3f850e68c7cf5452

Contents?: true

Size: 692 Bytes

Versions: 25

Compression:

Stored size: 692 Bytes

Contents

require 'spec_helper'
require 'cuba_api/config'

describe CubaApi::Config do

  before do
    Cuba.reset!
    Cuba.plugin CubaApi::Config
    Cuba[ :main ] = Cuba.method( :define )
    Cuba[ :name ] = :root
    class Other < Cuba; end
  end

  after { Cuba.config.clear }

  it 'should overwrite super-cuba' do
    Other[ :main ] = :other

    Cuba[ :main ].class.must.eq Method
    Other[ :main ].must.eq :other
  end

  it 'should inherit super-cuba on new attributes' do
    Cuba[ :more ] = :more

    Cuba[ :more ].must.eq :more
    Other[ :more ].must.eq :more
  end

  it 'should see config from super-cuba' do
    Cuba[ :name ].must.eq :root
    Other[ :name ].must.eq :root
  end
end

Version data entries

25 entries across 13 versions & 1 rubygems

Version Path
cuba-api-0.6.3 spec/current_user_spec.rb~
cuba-api-0.6.3 spec/config_spec.rb
cuba-api-0.6.2 spec/config_spec.rb
cuba-api-0.6.2 spec/current_user_spec.rb~
cuba-api-0.6.1 spec/config_spec.rb
cuba-api-0.6.1 spec/current_user_spec.rb~
cuba-api-0.6.0 spec/current_user_spec.rb~
cuba-api-0.6.0 spec/config_spec.rb
cuba-api-0.5.1 spec/current_user_spec.rb~
cuba-api-0.5.1 spec/config_spec.rb
cuba-api-0.5.0 spec/current_user_spec.rb~
cuba-api-0.5.0 spec/config_spec.rb
cuba-api-0.4.0 spec/current_user_spec.rb~
cuba-api-0.4.0 spec/config_spec.rb
cuba-api-0.3.3 spec/config_spec.rb
cuba-api-0.3.3 spec/current_user_spec.rb~
cuba-api-0.3.2 spec/current_user_spec.rb~
cuba-api-0.3.2 spec/config_spec.rb
cuba-api-0.3.1 spec/config_spec.rb
cuba-api-0.3.1 spec/current_user_spec.rb~