lopata 0.1.4 → 0.1.5
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 +4 -4
- data/lib/lopata/observers/backtrace_formatter.rb +2 -2
- data/lib/lopata/scenario_builder.rb +1 -1
- data/lib/lopata/step.rb +10 -15
- data/lib/lopata/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70e042bc80bb14342ec6b0f516df0934007677e8dd98ba04f2d65034ca6acbce
|
4
|
+
data.tar.gz: 5afff5a8553b777f02b0ee838f304d0d660afdc60042113423b52f08e91342db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f87e65d52c3bf6a15c85bfd5f900a48a576f256be20264a6df2360f8633694e88267f7cbd348325822b927538c5ad4407a55bd0ce3837c6ef630d685eec9074
|
7
|
+
data.tar.gz: 2d4c9fe43e2283e210e6c30e882941f99975e9e2b62a00d9a23b7f59208e02726c66b9c72bb2d612e117bd79c82f9fb3aa88e711ed4d3022226d9137f27b76e0
|
@@ -5,7 +5,7 @@ module Lopata
|
|
5
5
|
attr_accessor :exclusion_patterns, :inclusion_patterns
|
6
6
|
|
7
7
|
def initialize
|
8
|
-
patterns = %w[ /lib\d*/ruby/ bin/ exe/lopata /lib/bundler/ /exe/bundle
|
8
|
+
patterns = %w[ /lib\d*/ruby/ bin/ exe/lopata /lib/bundler/ /exe/bundle /\.rvm/ ]
|
9
9
|
patterns.map! { |s| Regexp.new(s.gsub("/", File::SEPARATOR)) }
|
10
10
|
|
11
11
|
@exclusion_patterns = [Regexp.union(*patterns)]
|
@@ -86,4 +86,4 @@ module Lopata
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
end
|
89
|
-
end
|
89
|
+
end
|
@@ -78,7 +78,7 @@ class Lopata::ScenarioBuilder
|
|
78
78
|
when /^(context)/ then Lopata::GroupStep
|
79
79
|
else Lopata::Step
|
80
80
|
end
|
81
|
-
step = step_class.new(method_name, *args, condition: condition, shared_step: shared_step,
|
81
|
+
step = step_class.new(method_name, *args, condition: condition, shared_step: shared_step, &block)
|
82
82
|
step.metadata = metadata
|
83
83
|
steps << step
|
84
84
|
end
|
data/lib/lopata/step.rb
CHANGED
@@ -1,27 +1,22 @@
|
|
1
1
|
module Lopata
|
2
2
|
class Step
|
3
|
-
attr_reader :block, :args, :condition, :method_name, :shared_step
|
3
|
+
attr_reader :block, :args, :condition, :method_name, :shared_step
|
4
4
|
# metadata overrien by the step.
|
5
5
|
attr_accessor :metadata
|
6
6
|
|
7
|
-
def initialize(method_name, *args, condition: nil, shared_step: nil,
|
7
|
+
def initialize(method_name, *args, condition: nil, shared_step: nil, &block)
|
8
8
|
@method_name = method_name
|
9
9
|
@args = args
|
10
10
|
@block = block
|
11
11
|
@shared_step = shared_step
|
12
12
|
@condition = condition
|
13
|
-
@group = group
|
14
13
|
initialized! if defined? initialized!
|
15
14
|
end
|
16
15
|
|
17
16
|
def title
|
18
17
|
base_title = args.first
|
19
18
|
base_title ||= shared_step && "#{method_name.capitalize} #{shared_step.name}" || "Untitled #{method_name}"
|
20
|
-
|
21
|
-
"#{group.title}: #{base_title}"
|
22
|
-
else
|
23
|
-
base_title
|
24
|
-
end
|
19
|
+
base_title
|
25
20
|
end
|
26
21
|
|
27
22
|
def execution_steps(scenario, groups: [])
|
@@ -67,11 +62,7 @@ module Lopata
|
|
67
62
|
end
|
68
63
|
|
69
64
|
def title
|
70
|
-
|
71
|
-
"%s: %s" % [group.title, method_name]
|
72
|
-
else
|
73
|
-
shared_step && "#{method_name.capitalize} #{shared_step.name}" || "Untitled #{method_name}"
|
74
|
-
end
|
65
|
+
shared_step && "#{method_name.capitalize} #{shared_step.name}" || "Untitled #{method_name}"
|
75
66
|
end
|
76
67
|
end
|
77
68
|
|
@@ -93,7 +84,6 @@ module Lopata
|
|
93
84
|
# Group step's block is a block in context of builder, not scenario. So hide the @block to not be used in scenario.
|
94
85
|
def initialized!
|
95
86
|
builder = Lopata::ScenarioBuilder.new(title)
|
96
|
-
builder.group = self
|
97
87
|
builder.instance_exec(&@block)
|
98
88
|
@steps = builder.steps
|
99
89
|
@block = nil
|
@@ -103,7 +93,7 @@ module Lopata
|
|
103
93
|
class StepExecution
|
104
94
|
attr_reader :step, :status, :exception, :block, :pending_message, :groups
|
105
95
|
extend Forwardable
|
106
|
-
def_delegators :step, :
|
96
|
+
def_delegators :step, :method_name
|
107
97
|
|
108
98
|
class PendingStepFixedError < StandardError; end
|
109
99
|
|
@@ -115,6 +105,11 @@ module Lopata
|
|
115
105
|
@groups = groups
|
116
106
|
end
|
117
107
|
|
108
|
+
def title
|
109
|
+
group_title = groups.map { |g| "#{g.title}: " }.join
|
110
|
+
"#{group_title}#{step.title}"
|
111
|
+
end
|
112
|
+
|
118
113
|
def run(scenario)
|
119
114
|
@status = :running
|
120
115
|
world.notify_observers(:step_started, self)
|
data/lib/lopata/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lopata
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Volochnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -139,5 +139,5 @@ requirements: []
|
|
139
139
|
rubygems_version: 3.0.3
|
140
140
|
signing_key:
|
141
141
|
specification_version: 4
|
142
|
-
summary: lopata-0.1.
|
142
|
+
summary: lopata-0.1.5
|
143
143
|
test_files: []
|