allure-ruby-commons 2.14.5 → 2.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35b9aec57c1f8d285f55f1463266c70daec925400f3880ddf6cacd2b237eb120
4
- data.tar.gz: 5fe9f0fcef4d39ed38cec526856712948f77c72529e13fe342e507ffcdf2ad2b
3
+ metadata.gz: 284b37ad75460156a0b06aa8725ae5687b69a6ee7aa9a59691cf5148e51b1db0
4
+ data.tar.gz: e635323b10208124ee787334132bde0c714fb70e42b1b969595e6c35e0eb989e
5
5
  SHA512:
6
- metadata.gz: b0d038d11530965ea7cc37135496fe4e0071a8fb8f975d9bad3be724e5c04b9b88ae6027a2cd6a2ed227e499742e2ec35cb63e87062bbcec0696b6def3609ed8
7
- data.tar.gz: 7a9dca1b51f2d0948aec73ef6749a289a8ef6be9831dcca3ba80292defedb42c58ad47e2cfce8b810bf2845ea0e02963bb5b9135bb29b422e9b854b9385b5dab
6
+ metadata.gz: 2c90af87fa423669ec1bf027bbd32f316a567df317f9d07ea03a9dab86107f2753609f00208510bb1ca9b4f5c4f71a20cfda08f4332ad2f667bfb8053be4fb08
7
+ data.tar.gz: 56bf9f7d9ea0ae31d8b35749d999a9b2a98d3dca0de6ee27124a428402a2d152a2c6b7874faa2f3b97e363155debfcea9b7ad2d76b40199eed7e6f663f322059
data/README.md CHANGED
@@ -53,6 +53,22 @@ It is possible to set up custom allure environment which will be used as custom
53
53
  * via `ALLURE_ENVIRONMENT` environment variable
54
54
  * via `configure` method
55
55
 
56
+ ### Environment properties
57
+
58
+ To add additional environment information to the report it is possible to set configuration property `environment_properties`.
59
+
60
+ Option can be set to hash or block returning a hash:
61
+
62
+ ```ruby
63
+ # hash
64
+ config.environment_properties = {
65
+ custom_attribute: "foo"
66
+ }
67
+
68
+ # lambda
69
+ config.environment_properties = -> { { custom_attributes: "foo"} }
70
+ ```
71
+
56
72
  ### Log level
57
73
 
58
74
  Log level can be also configured via environment variable `ALLURE_LOG_LEVEL` which accepts one of the following values: `DEBUG INFO WARN ERROR FATAL UNKNOWN`.
@@ -164,7 +164,7 @@ module Allure
164
164
  # Manually create environment.properties file
165
165
  # if this method is called before test run started and
166
166
  # option clean_results_directory is enabled, the file will be deleted
167
- # @param [Hash<Symbol, String>] environment
167
+ # @param [Hash<Symbol, String>, Proc] environment
168
168
  # @return [void]
169
169
  def add_environment(environment)
170
170
  lifecycle.write_environment(environment)
@@ -223,12 +223,13 @@ module Allure
223
223
 
224
224
  # Add environment.properties file
225
225
  #
226
- # @param [Hash] env
226
+ # @param [Hash, Proc] env
227
227
  # @return [void]
228
228
  def write_environment(env = config.environment_properties)
229
229
  return unless env
230
230
 
231
- file_writer.write_environment(env)
231
+ env_properties = env.respond_to?(:call) ? env.call : env
232
+ file_writer.write_environment(env_properties)
232
233
  end
233
234
 
234
235
  # Add categories.json
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: allure-ruby-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.5
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-18 00:00:00.000000000 Z
11
+ date: 2021-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types