test/api_stub/requests/storage/file.rb in far-gem-0.5.1 vs test/api_stub/requests/storage/file.rb in far-gem-0.5.2
- old
+ new
@@ -3,9 +3,18 @@
module Storage
# Mock class for Deployment Requests
# Below data should be as same as those in Mock classes in lib/fog/azurerm/requests/storage/*.rb
class File
def self.blob
+ blob_data = blob_as_hash
+ blob = Azure::Storage::Blob::Blob.new
+ blob.name = blob_data['name']
+ blob.metadata = blob_data['metadata']
+ blob.properties = blob_data['properties'].map { |k, v| { k.to_sym => v } }.reduce({}, &:merge!)
+ blob
+ end
+
+ def self.blob_as_hash
{
'name' => 'test_blob',
'metadata' => {},
'properties' => {
'last_modified' => 'Mon, 04 Jul 2016 09:30:31 GMT',