allure-ruby-commons 2.13.5.rc.1 → 2.13.5.rc.2

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: b5e32590e85ab38aeb176662bbc9347d4db8f403b1a79faff049d54cc42ef148
4
- data.tar.gz: a9fac0c1035c7a7e17aa4f08f07f461cf08c6d4dad69f10a935b08d0bb1393c1
3
+ metadata.gz: 581048b28120c18ec370a5f7ece97995f5f9bd0078cb3f17c00ff739eb9d3b2b
4
+ data.tar.gz: 03f1f125e6f50bd29a46084da967bde18f77d7e1c00c5ef1617b7a68f393bc07
5
5
  SHA512:
6
- metadata.gz: 9f101580f643b021d6854a9eb21e5aad0ff0d52a379b6dde1777390a50274bc9a513f51c0546729f3500f0d82759e6704fb25176d980e16db73064da79cb8131
7
- data.tar.gz: d7acaf42f7f33cc2b7dd6fd81d99a40055603abe06cd1df1136e1472c0de6e2c18824f0b26e520e1ddf7a76be606940dc7de737dcc14a2131a829eccfd5e8c04
6
+ metadata.gz: 25a402179621527683817fa38945a83b25300cef9794cc7b04c84b694e85deed38681a131c429cc6f0740291b98726cd70a2f2cabdc25e33eecd3168bcc95c1b
7
+ data.tar.gz: b40a85e6cf5d0867f39dcad5e94fe60e904a65961dd5e2058103f44b4b0b6f72b7d015088f421edd44ec5bb2ce0773f577cac3adff7439d94f245a10076dbb9e
data/README.md CHANGED
@@ -11,7 +11,7 @@ you can just create the report of any other kind using the basic Allure terms.
11
11
  Add the dependency to your Gemfile
12
12
 
13
13
  ```ruby
14
- gem 'allure-ruby-commons'
14
+ gem "allure-ruby-commons"
15
15
  ```
16
16
 
17
17
  ## Configuration
@@ -19,13 +19,13 @@ Add the dependency to your Gemfile
19
19
  Following configuration options are supported:
20
20
 
21
21
  ```ruby
22
- Allure.configure do |c|
23
- c.results_directory = "/whatever/you/like"
24
- c.clean_results_directory = true
25
- c.logging_level = Logger::INFO
22
+ Allure.configure do |config|
23
+ config.results_directory = "/whatever/you/like"
24
+ config.clean_results_directory = true
25
+ config.logging_level = Logger::INFO
26
26
  # these are used for creating links to bugs or test cases where {} is replaced with keys of relevant items
27
- c.link_tms_pattern = "http://www.jira.com/browse/{}"
28
- c.link_issue_pattern = "http://www.jira.com/browse/{}"
27
+ config.link_tms_pattern = "http://www.jira.com/browse/{}"
28
+ config.link_issue_pattern = "http://www.jira.com/browse/{}"
29
29
  end
30
30
  ```
31
31
 
@@ -9,30 +9,30 @@ require_rel "allure_ruby_commons/**/*rb"
9
9
  module Allure
10
10
  class << self
11
11
  # Get thread specific allure lifecycle object
12
- # @return [Allure::AllureLifecycle]
12
+ # @return [AllureLifecycle]
13
13
  def lifecycle
14
14
  Thread.current[:lifecycle] ||= AllureLifecycle.new
15
15
  end
16
16
 
17
17
  # Set lifecycle object
18
- # @param [Allure::AllureLifecycle] lifecycle
18
+ # @param [AllureLifecycle] lifecycle
19
19
  # @return [void]
20
20
  def lifecycle=(lifecycle)
21
21
  Thread.current[:lifecycle] = lifecycle
22
22
  end
23
23
 
24
24
  # Get allure configuration
25
- # @return [Allure::Config]
25
+ # @return [Config]
26
26
  def configuration
27
- Config
27
+ Config.instance
28
28
  end
29
29
 
30
30
  # Set allure configuration
31
- # @yieldparam [Allure::Config]
31
+ # @yieldparam [Config]
32
32
  # @yieldreturn [void]
33
33
  # @return [void]
34
34
  def configure
35
- yield(Config)
35
+ yield(configuration)
36
36
  end
37
37
 
38
38
  # Add epic to current test case
@@ -131,7 +131,7 @@ module Allure
131
131
  # Add attachment to current test case or step
132
132
  # @param [String] name Attachment name
133
133
  # @param [File, String] source File or string to save as attachment
134
- # @param [String] type attachment type defined in {Allure::ContentType} or any other valid mime type
134
+ # @param [String] type attachment type defined in {ContentType} or any other valid mime type
135
135
  # @param [Boolean] test_case add attachment to current test case instead of test step
136
136
  # @return [void]
137
137
  def add_attachment(name:, source:, type:, test_case: false)
@@ -146,7 +146,7 @@ module Allure
146
146
  end
147
147
 
148
148
  # Add categories info
149
- # @param [File, Array<Allure::Category>] categories
149
+ # @param [File, Array<Category>] categories
150
150
  # @return [void]
151
151
  def add_categories(categories)
152
152
  lifecycle.write_categories(categories)
@@ -154,7 +154,7 @@ module Allure
154
154
 
155
155
  # Add step with provided name and optional status to current test step, fixture or test case
156
156
  # @param [String] name
157
- # @param [Symbol] status <Allure::Status>, <Allure::Status::PASSED> by default
157
+ # @param [Symbol] status {Status}, {Status::PASSED} by default
158
158
  # @return [void]
159
159
  def step(name:, status: nil)
160
160
  lifecycle.add_test_step(StepResult.new(name: name, status: status || Status::PASSED, stage: Stage::FINISHED))
@@ -11,7 +11,7 @@ module Allure
11
11
  def initialize
12
12
  @test_context = []
13
13
  @step_context = []
14
- @logger = Logger.new(STDOUT, level: Config.logging_level)
14
+ @logger = Logger.new(STDOUT, level: Config.instance.logging_level)
15
15
  @file_writer = FileWriter.new
16
16
  end
17
17
 
@@ -1,26 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "logger"
4
+ require "singleton"
4
5
 
5
6
  module Allure
6
7
  # Allure configuration class
7
8
  class Config
9
+ include Singleton
10
+
8
11
  # @return [String] default allure results directory
9
12
  DEFAULT_RESULTS_DIRECTORY = "reports/allure-results"
10
13
  # @return [String] default loggin level
11
14
  DEFAULT_LOGGING_LEVEL = Logger::INFO
12
15
 
13
- class << self
14
- attr_accessor :link_tms_pattern, :link_issue_pattern, :clean_results_directory
15
- attr_writer :results_directory, :logging_level
16
+ attr_accessor :link_tms_pattern, :link_issue_pattern, :clean_results_directory
17
+ attr_writer :results_directory, :logging_level
16
18
 
17
- def results_directory
18
- @results_directory || DEFAULT_RESULTS_DIRECTORY
19
- end
19
+ def results_directory
20
+ @results_directory || DEFAULT_RESULTS_DIRECTORY
21
+ end
20
22
 
21
- def logging_level
22
- @logging_level || DEFAULT_LOGGING_LEVEL
23
- end
23
+ def logging_level
24
+ @logging_level || DEFAULT_LOGGING_LEVEL
24
25
  end
25
26
  end
26
27
  end
@@ -59,7 +59,7 @@ module Allure
59
59
  private
60
60
 
61
61
  def output_dir
62
- @output_dir ||= FileUtils.mkpath(Allure::Config.results_directory).first
62
+ @output_dir ||= FileUtils.mkpath(Config.instance.results_directory).first
63
63
  end
64
64
 
65
65
  def write(name, source)
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.13.5.rc.1
4
+ version: 2.13.5.rc.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrejs Cunskis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-28 00:00:00.000000000 Z
11
+ date: 2020-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: uuid