gitlab-fog-azure-rm 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8e22573f58ecdd3a318e5b75145645b6828d557320e00d3833ac6bb552c12a27
4
- data.tar.gz: 02e55258c8128b9e00cdcf1d4659e270b58f9382b362555c49a73f260586e129
3
+ metadata.gz: 96a2a16b2feac00c533b0489e6572ccd808c11e44f9f3efab5b69bdc392aea04
4
+ data.tar.gz: 8e7a5d519fa7002896efb7c00fe7bb73440f875cc0a428dba625695ed6c385bb
5
5
  SHA512:
6
- metadata.gz: 65983b2a6caa2de4444fdde0b27053519588df069809894445c52123242afedfc3f5357434c754b361e5234eae5230ac86c1b3d208b10ea2615fbdb74bb8e347
7
- data.tar.gz: bad2b6523176bc008228137172e50f1059333f59428de88e7cc237892650056e92987aff983436ef1086b12cdf8c5e72f4cf0c7727059b88b6af5fcd71a3f224
6
+ metadata.gz: 36e3c183ee97204706d901c25c3791b760980d0dcf84440d2370dddff622f54670db85a11e1badec9853341e661d057d519b990912b626c9d86e16c9461e2ebf
7
+ data.tar.gz: b20976bdfab522b172572194e2f6f0693129c3f6315910fb9d8331cd11e9855ecce53292f22d982b7d6c7811267bce716cf6e680a04d3bf9e703988ee21b2f1e
data/.gitlab-ci.yml CHANGED
@@ -14,7 +14,7 @@ test:
14
14
  - bundle exec rake test
15
15
  parallel:
16
16
  matrix:
17
- - RUBY_VERSION: [ "2.7", "3.0", "3.1" ]
17
+ - RUBY_VERSION: [ "2.7", "3.0", "3.1", "3.2" ]
18
18
 
19
19
  rubocop:
20
20
  script:
data/.rubocop.yml CHANGED
@@ -2,4 +2,4 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
4
  NewCops: enable
5
-
5
+ TargetRubyVersion: 2.7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 1.7.0
4
+
5
+ - Fix #get_object return type to be consistent with other Fog providers !36
6
+ - Require Ruby 2.7+ !36
7
+
3
8
  ## 1.6.0
4
9
 
5
10
  - Add get_object request method !34
@@ -15,7 +15,7 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'https://gitlab.com/gitlab-org/gitlab-fog-azure-rm'
16
16
  spec.rdoc_options = %w[--charset=UTF-8]
17
17
  spec.extra_rdoc_files = %w[README.md]
18
- spec.required_ruby_version = '>= 2.0.0'
18
+ spec.required_ruby_version = '>= 2.7.0'
19
19
  spec.post_install_message = 'Thanks for installing!'
20
20
  spec.add_development_dependency 'codeclimate-test-reporter' , '~> 1.0.0'
21
21
  spec.add_development_dependency 'minitest', '~> 5.8.4'
@@ -3,12 +3,22 @@ module Fog
3
3
  class AzureRM
4
4
  # This class provides the actual implemention for service calls.
5
5
  class Real
6
- alias get_object get_blob
6
+ def get_object(...)
7
+ blob, body = get_blob(...)
8
+
9
+ blob[:body] = body
10
+ blob
11
+ end
7
12
  end
8
13
 
9
14
  # This class provides the mock implementation for unit tests.
10
15
  class Mock
11
- alias get_object get_blob
16
+ def get_object(...)
17
+ blob, body = get_blob(...)
18
+
19
+ blob[:body] = body
20
+ blob
21
+ end
12
22
  end
13
23
  end
14
24
  end
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module AzureRM
3
- VERSION = '1.6.0'.freeze
3
+ VERSION = '1.7.0'.freeze
4
4
  end
5
5
  end
@@ -26,12 +26,6 @@ class TestGetBlob < Minitest::Test
26
26
  end
27
27
  end
28
28
 
29
- def test_get_object_success
30
- @blob_client.stub :get_blob, @blob_with_content do
31
- assert_equal @blob_with_content, @service.get_object('test_container', 'test_blob')
32
- end
33
- end
34
-
35
29
  def test_get_blob_not_found
36
30
  exception = ->(*) { raise StandardError.new('Not found(404). Not exist') }
37
31
  @blob_client.stub :get_blob, exception do
@@ -41,15 +35,6 @@ class TestGetBlob < Minitest::Test
41
35
  end
42
36
  end
43
37
 
44
- def test_get_object_not_found
45
- exception = ->(*) { raise StandardError.new('Not found(404). Not exist') }
46
- @blob_client.stub :get_blob, exception do
47
- assert_raises('NotFound') do
48
- @service.get_object('test_container', 'test_blob')
49
- end
50
- end
51
- end
52
-
53
38
  def test_get_blob_http_exception
54
39
  http_exception = ->(*) { raise Azure::Core::Http::HTTPError.new(@mocked_response) }
55
40
  @blob_client.stub :get_blob, http_exception do
@@ -0,0 +1,34 @@
1
+ require File.expand_path '../../test_helper', __dir__
2
+
3
+ # Storage Blob Class
4
+ class TestGetObject < Minitest::Test
5
+ # This class posesses the test cases for the requests of getting storage blob.
6
+ def setup
7
+ Fog.mock!
8
+ @mock_service = Fog::Storage::AzureRM.new(storage_account_credentials)
9
+ Fog.unmock!
10
+ @mocked_response = mocked_storage_http_error
11
+
12
+ @service = Fog::Storage::AzureRM.new(storage_account_credentials)
13
+ @blob_client = @service.instance_variable_get(:@blob_client)
14
+
15
+ @raw_cloud_blob = storage_blob
16
+ @blob = ApiStub::Requests::Storage::File.blob_as_hash
17
+ @blob_with_content = @blob.merge(body: 'content')
18
+ end
19
+
20
+ def test_get_object_success
21
+ @blob_client.stub :get_blob, @blob_with_content do
22
+ assert_equal @blob_with_content, @service.get_object('test_container', 'test_blob')
23
+ end
24
+ end
25
+
26
+ def test_get_object_not_found
27
+ exception = ->(*) { raise StandardError.new('Not found(404). Not exist') }
28
+ @blob_client.stub :get_blob, exception do
29
+ assert_raises('NotFound') do
30
+ @service.get_object('test_container', 'test_blob')
31
+ end
32
+ end
33
+ end
34
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-fog-azure-rm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shaffan Chaudhry
@@ -305,6 +305,7 @@ files:
305
305
  - test/requests/storage/test_get_container_acl.rb
306
306
  - test/requests/storage/test_get_container_properties.rb
307
307
  - test/requests/storage/test_get_container_url.rb
308
+ - test/requests/storage/test_get_object.rb
308
309
  - test/requests/storage/test_list_blobs.rb
309
310
  - test/requests/storage/test_list_containers.rb
310
311
  - test/requests/storage/test_put_blob_block.rb
@@ -334,7 +335,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
334
335
  requirements:
335
336
  - - ">="
336
337
  - !ruby/object:Gem::Version
337
- version: 2.0.0
338
+ version: 2.7.0
338
339
  required_rubygems_version: !ruby/object:Gem::Requirement
339
340
  requirements:
340
341
  - - ">="