Sha256: f369385104602dfbd35b3bf09261df11fbd77552e68c8bf1d53b480bd428f119
Contents?: true
Size: 1.45 KB
Versions: 4
Compression:
Stored size: 1.45 KB
Contents
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) $LOAD_PATH.unshift(File.dirname(__FILE__)) MODELS = File.join(File.dirname(__FILE__), "app/models") require 'rspec' require 'dynamoid' require 'pry' require 'mocha' require 'aws-sdk' ENV['ACCESS_KEY'] ||= 'abcd' ENV['SECRET_KEY'] ||= '1234' AWS.config({ :access_key_id => ENV['ACCESS_KEY'], :secret_access_key => ENV['SECRET_KEY'], :dynamo_db_endpoint => 'localhost', :dynamo_db_port => '4567', :use_ssl => false }) Dynamoid.configure do |config| config.adapter = 'aws_sdk' config.namespace = 'dynamoid_tests' config.warn_on_scan = false end Dynamoid.logger.level = Logger::FATAL # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require file } RSpec.configure do |config| config.alias_it_should_behave_like_to :configured_with, "configured with" config.mock_with(:mocha) config.before(:each) do Dynamoid::Adapter.list_tables.each do |table| if table =~ /^#{Dynamoid::Config.namespace}/ table = Dynamoid::Adapter.get_table(table) table.items.each {|i| i.delete} end end end config.after(:suite) do Dynamoid::Adapter.list_tables.each do |table| Dynamoid::Adapter.delete_table(table) if table =~ /^#{Dynamoid::Config.namespace}/ end end end
Version data entries
4 entries across 4 versions & 2 rubygems
Version | Path |
---|---|
dynamoid-moda-0.7.2 | spec/spec_helper.rb |
dynamoid-moda-0.7.1 | spec/spec_helper.rb |
dynamoid-0.7.1 | spec/spec_helper.rb |
dynamoid-0.7.0 | spec/spec_helper.rb |