Sha256: 3879ff9a729602ea78ba915cbb489070941075a9d8f420e956f2e35e37dd64d1

Contents?: true

Size: 853 Bytes

Versions: 25

Compression:

Stored size: 853 Bytes

Contents

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

describe "Dynamoid::Config" do
  
  before(:each) do
    Dynamoid::Config.reset_namespace
  end
  
  after(:each) do
    Dynamoid.config {|config| config.namespace = 'dynamoid_tests'}
  end

  it 'returns a namespace for non-Rails apps' do
    Dynamoid::Config.namespace.should == 'dynamoid'
  end
  
  it 'returns a namespace for Rails apps' do
    class Rails; end
    Rails.stubs(:application => stubs(:class => stubs(:parent_name => 'TestApp')))
    Rails.stubs(:env => 'development')
    Dynamoid::Config.send(:option, :namespace, :default => defined?(Rails) ? "dynamoid_#{Rails.application.class.parent_name}_#{Rails.env}" : "dynamoid")
    
    # TODO Make this return what we actually expect
    Dynamoid::Config.namespace.should == "dynamoid_Mocha_development"
  end
  
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
dynamoid-moda-0.7.2 spec/dynamoid/config_spec.rb
dynamoid-moda-0.7.1 spec/dynamoid/config_spec.rb
dynamoid-0.7.1 spec/dynamoid/config_spec.rb
dynamoid-0.7.0 spec/dynamoid/config_spec.rb
dynamoid-0.6.1 spec/dynamoid/config_spec.rb
dynamoid-0.6.0 spec/dynamoid/config_spec.rb
adept_dynamoid-0.6.0 spec/dynamoid/config_spec.rb
adept_dynamoid-0.5.0.8 spec/dynamoid/config_spec.rb
adept_dynamoid-0.5.0.7 spec/dynamoid/config_spec.rb
adept_dynamoid-0.5.0.6 spec/dynamoid/config_spec.rb
dynamoid-0.5.0 spec/dynamoid/config_spec.rb
dynamoid-0.4.1 spec/dynamoid/config_spec.rb
dynamoid-0.4.0 spec/dynamoid/config_spec.rb
dynamoid-0.3.2 spec/dynamoid/config_spec.rb
dynamoid-0.3.1 spec/dynamoid/config_spec.rb
dynamoid-0.3.0 spec/dynamoid/config_spec.rb
dynamoid-0.2.0 spec/dynamoid/config_spec.rb
dynamoid-0.1.2 spec/dynamoid/config_spec.rb
dynamoid-0.1.1 spec/dynamoid/config_spec.rb
dynamoid-0.1.0 spec/dynamoid/config_spec.rb