mirror of
https://github.com/wahyd4/ruby-sdk.git
synced 2026-08-09 04:46:10 +10:00
23 lines
608 B
Ruby
Executable File
23 lines
608 B
Ruby
Executable File
# -*- encoding: utf-8 -*-
|
|
|
|
require 'bundler/setup'
|
|
require 'qiniu'
|
|
require 'rspec'
|
|
|
|
RSpec.configure do |config|
|
|
config.before :all do
|
|
Qiniu.establish_connection! :access_key => ENV["QINIU_ACCESS_KEY"], :secret_key => ENV["QINIU_SECRET_KEY"]
|
|
end
|
|
config.before :each, :not_set_ak_sk => true do
|
|
Qiniu.establish_connection! :access_key => nil, :secret_key => nil
|
|
end
|
|
end
|
|
|
|
def make_unique_bucket (bucket)
|
|
bucket + "-" + ENV["QINIU_ACCESS_KEY"][0, 8]
|
|
end # make_unique_bucket
|
|
|
|
def make_unique_key_in_bucket (key)
|
|
"#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}-" + key
|
|
end # make_unique_key_in_bucket
|