Sha256: 3d194b78f27b506470beb32b5fb3b7242bffe4733dde8c2fe75772c9952ff01e
Contents?: true
Size: 824 Bytes
Versions: 2
Compression:
Stored size: 824 Bytes
Contents
require File.dirname(__FILE__) + '/spec_helper' require "open-uri" require "net/http" describe "Aliyun" do before(:all) do opts = { :aliyun_access_id => ALIYUN_ACCESS_ID, :aliyun_access_key => ALIYUN_ACCESS_KEY, :aliyun_bucket => ALIYUN_BUCKET } @connection = CarrierWave::Storage::Aliyun::Connection.new(opts) end it "should put" do url = @connection.put("a/a.jpg",load_file("foo.jpg").read) Net::HTTP.get_response(URI.parse(url)).code.should == "200" end it "should put with / prefix" do url = @connection.put("/a/a.jpg",load_file("foo.jpg").read) Net::HTTP.get_response(URI.parse(url)).code.should == "200" end it "should delete" do url = @connection.delete("/a/a.jpg") Net::HTTP.get_response(URI.parse(url)).code.should == "404" end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
carrierwave-aliyun-0.1.4 | spec/aliyun_spec.rb |
carrierwave-aliyun-0.1.3 | spec/aliyun_spec.rb |