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