cucumber-tag_expressions 1.1.1 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/spec/capture_warnings.rb +74 -0
- data/spec/coverage.rb +2 -1
- metadata +13 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3246b2aea24031cf8280e59a4a16b62917a39f997725601ba228f76513f14a52
|
4
|
+
data.tar.gz: d83b8f7420ecf4c26d0e93903dadb7f2c8583759e559604d38817bc1f5d0ea36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 751c21cd9f06c1e6b4d8384b48d9a00f44b901168d10a4346aad10656f22fd28e006e2923b7af82bb6609d6704b23f23f13b2ce960359c8a00b664f636e15f34
|
7
|
+
data.tar.gz: 174e806076827c8923bed8982e8618c7e3eef46fb00080bb56d91838300d97d0c14ee4b57a8f8c13f31f6bb0b00701cc2eff28054b05c1711a1f4a51806889c1
|
data/README.md
CHANGED
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# With thanks to @myronmarston
|
3
|
+
# https://github.com/vcr/vcr/blob/master/spec/capture_warnings.rb
|
4
|
+
|
5
|
+
module CaptureWarnings
|
6
|
+
def report_warnings(&block)
|
7
|
+
current_dir = Dir.pwd
|
8
|
+
warnings, errors = capture_error(&block).partition { |line| line.include?('warning') }
|
9
|
+
project_warnings, other_warnings = warnings.uniq.partition { |line| line.include?(current_dir) }
|
10
|
+
|
11
|
+
if errors.any?
|
12
|
+
puts errors.join("\n")
|
13
|
+
end
|
14
|
+
|
15
|
+
if other_warnings.any?
|
16
|
+
puts "#{ other_warnings.count } warnings detected, set VIEW_OTHER_WARNINGS=true to see them."
|
17
|
+
print_warnings('other', other_warnings) if ENV['VIEW_OTHER_WARNINGS']
|
18
|
+
end
|
19
|
+
|
20
|
+
# Until they fix https://bugs.ruby-lang.org/issues/10661
|
21
|
+
if RUBY_VERSION == "2.2.0"
|
22
|
+
project_warnings = project_warnings.reject { |w| w =~ /warning: possible reference to past scope/ }
|
23
|
+
end
|
24
|
+
|
25
|
+
if project_warnings.any?
|
26
|
+
puts "#{ project_warnings.count } warnings detected"
|
27
|
+
print_warnings('cucumber-expressions', project_warnings)
|
28
|
+
fail "Please remove all cucumber-expressions warnings."
|
29
|
+
end
|
30
|
+
|
31
|
+
ensure_system_exit_if_required
|
32
|
+
end
|
33
|
+
|
34
|
+
def capture_error(&block)
|
35
|
+
old_stderr = STDERR.clone
|
36
|
+
pipe_r, pipe_w = IO.pipe
|
37
|
+
pipe_r.sync = true
|
38
|
+
error = String.new
|
39
|
+
reader = Thread.new do
|
40
|
+
begin
|
41
|
+
loop do
|
42
|
+
error << pipe_r.readpartial(1024)
|
43
|
+
end
|
44
|
+
rescue EOFError
|
45
|
+
end
|
46
|
+
end
|
47
|
+
STDERR.reopen(pipe_w)
|
48
|
+
block.call
|
49
|
+
ensure
|
50
|
+
capture_system_exit
|
51
|
+
STDERR.reopen(old_stderr)
|
52
|
+
pipe_w.close
|
53
|
+
reader.join
|
54
|
+
return error.split("\n")
|
55
|
+
end
|
56
|
+
|
57
|
+
def print_warnings(type, warnings)
|
58
|
+
puts
|
59
|
+
puts "-" * 30 + " #{type} warnings: " + "-" * 30
|
60
|
+
puts
|
61
|
+
puts warnings.join("\n")
|
62
|
+
puts
|
63
|
+
puts "-" * 75
|
64
|
+
puts
|
65
|
+
end
|
66
|
+
|
67
|
+
def ensure_system_exit_if_required
|
68
|
+
raise @system_exit if @system_exit
|
69
|
+
end
|
70
|
+
|
71
|
+
def capture_system_exit
|
72
|
+
@system_exit = $!
|
73
|
+
end
|
74
|
+
end
|
data/spec/coverage.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
require 'simplecov'
|
3
|
-
formatters = [SimpleCov::Formatter::HTMLFormatter]
|
3
|
+
formatters = [ SimpleCov::Formatter::HTMLFormatter ]
|
4
4
|
|
5
5
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(*formatters)
|
6
|
+
SimpleCov.add_filter 'spec/'
|
6
7
|
SimpleCov.start
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-tag_expressions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrea Nodari
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -80,13 +80,19 @@ files:
|
|
80
80
|
- lib/cucumber/tag_expressions.rb
|
81
81
|
- lib/cucumber/tag_expressions/expressions.rb
|
82
82
|
- lib/cucumber/tag_expressions/parser.rb
|
83
|
+
- spec/capture_warnings.rb
|
83
84
|
- spec/coverage.rb
|
84
85
|
- spec/expressions_spec.rb
|
85
86
|
- spec/parser_spec.rb
|
86
|
-
homepage: https://docs.cucumber.io/tag-expressions
|
87
|
+
homepage: https://docs.cucumber.io/cucumber/api/#tag-expressions
|
87
88
|
licenses:
|
88
89
|
- MIT
|
89
|
-
metadata:
|
90
|
+
metadata:
|
91
|
+
bug_tracker_uri: https://github.com/cucumber/cucumber/issues
|
92
|
+
changelog_uri: https://github.com/cucumber/cucumber/blob/master/tag-expressions/CHANGELOG.md
|
93
|
+
documentation_uri: https://docs.cucumber.io/cucumber/api/#tag-expressions
|
94
|
+
mailing_list_uri: https://groups.google.com/forum/#!forum/cukes
|
95
|
+
source_code_uri: https://github.com/cucumber/cucumber/blob/master/tag-expressions/ruby
|
90
96
|
post_install_message:
|
91
97
|
rdoc_options:
|
92
98
|
- "--charset=UTF-8"
|
@@ -104,11 +110,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
110
|
version: '0'
|
105
111
|
requirements: []
|
106
112
|
rubyforge_project:
|
107
|
-
rubygems_version: 2.6.
|
113
|
+
rubygems_version: 2.7.6.2
|
108
114
|
signing_key:
|
109
115
|
specification_version: 4
|
110
|
-
summary: cucumber-tag_expressions-
|
116
|
+
summary: cucumber-tag_expressions-2.0.1
|
111
117
|
test_files:
|
118
|
+
- spec/capture_warnings.rb
|
112
119
|
- spec/parser_spec.rb
|
113
120
|
- spec/coverage.rb
|
114
121
|
- spec/expressions_spec.rb
|