convenient_service 0.3.0 → 0.3.1

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: b6eab7876ae6995ff2a0f2f4322a972ad05aae9b4ef3beea93daee900779dc39
4
- data.tar.gz: 11d7e604831dda483449dc2b2513c0fc5817fd6172740836e5e3929b7d6fbcd4
3
+ metadata.gz: 0a88c73bc0e44152c9d0655a5135f2f32251d285e62e605e865f55fabca3d90c
4
+ data.tar.gz: 9bef951c44bba900eb78324944f80a5d7f37b066ac7b9760aa243e016b9c11a0
5
5
  SHA512:
6
- metadata.gz: b422032aa3b32d20579fdcc7e540a5d48e6dd18b3b69182b4b7bc456bbd8a381dd1cdab5654662e1074e095a124d15751aa001d15a36c21518dba0a1683f7130
7
- data.tar.gz: bc8142c8d9df3971efb3476131608aae89477a46ecbe2efe42e31555f52e2425930c122ff93f8d941f4b44aa1c81b291079b5e11ea0249cfea0d0dd47a0846b7
6
+ metadata.gz: d00b17feb539b7c54e970eedefff69ff840ae1a9811d927309e01bf19869a058f67a3c7e76e9feb9a825bc466c04cc52d5cd9f52ce607ed865d803fd847182ac
7
+ data.tar.gz: 1200ca17ea22193c8f1fef2b36d7a81bbdbf759348191180e2808c03ba66a0b7d2219cfb3062874833f80c4a677ff07b49f6e19e2a888e38e3c4a2c33d0b7010
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1](https://github.com/marian13/convenient_service/compare/v0.3.0...v0.3.1) (2022-12-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **can_have_stubbed_result:** fix stubbed_result when it's called in non-test env ([e25178e](https://github.com/marian13/convenient_service/commit/e25178ef502e198d498703172b25e1fb94e702a4))
9
+
3
10
  ## [0.3.0](https://github.com/marian13/convenient_service/compare/v0.2.1...v0.3.0) (2022-12-17)
4
11
 
5
12
 
@@ -20,6 +20,8 @@ module ConvenientService
20
20
  # TODO: Mutex for thread-safety when parallel steps will be supported.
21
21
  #
22
22
  def stubbed_results
23
+ return Support::Cache.new unless Support::Gems::RSpec.current_example
24
+
23
25
  cache = Utils::Object.instance_variable_fetch(::RSpec.current_example, :@__convenient_service_stubbed_results__) { Support::Cache.new }
24
26
 
25
27
  cache.scope(self)
@@ -29,6 +29,21 @@ module ConvenientService
29
29
  def version
30
30
  loaded? ? Support::Version.new(::RSpec::Core::Version::STRING) : Support::Version.null_version
31
31
  end
32
+
33
+ ##
34
+ # @return [RSpec::Core::Example, nil]
35
+ #
36
+ # @internal
37
+ # NOTE: Returns `nil` in a non-test environment
38
+ #
39
+ # `::RSpec.current_example` docs:
40
+ # - https://www.rubydoc.info/github/rspec/rspec-core/RSpec.current_example
41
+ # - https://github.com/rspec/rspec-core/blob/v3.12.0/lib/rspec/core.rb#L122
42
+ # - https://relishapp.com/rspec/rspec-core/docs/metadata/current-example
43
+ #
44
+ def current_example
45
+ ::RSpec.current_example if loaded?
46
+ end
32
47
  end
33
48
  end
34
49
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConvenientService
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: convenient_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marian Kostyk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-17 00:00:00.000000000 Z
11
+ date: 2022-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal