spec/aliyun_spec.rb in carrierwave-aliyun-oss-0.4.5 vs spec/aliyun_spec.rb in carrierwave-aliyun-oss-0.4.6

- old
+ new

@@ -23,13 +23,12 @@ expect(res.code).to eq "200" end it "should get" do content = "" - obj = @connection.get("a/a.jpg"){|chunk| content = chunk} - expect(content.length).to be >0 - expect(obj.size).to be >0 - expect(obj.headers).not_to be_empty + obj = @connection.get("a/a.jpg"){|chunk| content << chunk} + expect(content.length).to eq(obj.size) + expect(open(@connection.path_to_url("a/a.jpg")){|f| f.read}).to eq(content) end it "should put with / prefix" do url = @connection.put("/a/a.jpg",load_file("foo.jpg")) res = Net::HTTP.get_response(URI.parse(url))