lopata 0.1.4 → 0.1.5

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: 1155fd7582bb7ca2639810d0339f61499124cfb92d10f181adf728f88b5cc738
4
- data.tar.gz: c447507475f7310be478205d0dda7e331dfe26e037ba7676035b105fa6c09a62
3
+ metadata.gz: 70e042bc80bb14342ec6b0f516df0934007677e8dd98ba04f2d65034ca6acbce
4
+ data.tar.gz: 5afff5a8553b777f02b0ee838f304d0d660afdc60042113423b52f08e91342db
5
5
  SHA512:
6
- metadata.gz: 363d77e825eda675203f046a0c844612d6e40c2324e8715ce3f690a33b0f3d1733a6831998d5cdbda7add08937f1f69d71fc40bd7abf7ece43405cd90ee7f62c
7
- data.tar.gz: 1ea19098de32d259087cc480c0e18722655606feb39a0368a40cda5ed888d87ae5bbfcb616050c3f8cb4d79cdb0a8a02a14a56a259f150f2bfeebc257f335176
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, group: group, &block)
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
@@ -1,27 +1,22 @@
1
1
  module Lopata
2
2
  class Step
3
- attr_reader :block, :args, :condition, :method_name, :shared_step, :group
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, group: nil, &block)
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
- if group
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
- if group
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, :title, :method_name
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)
@@ -1,5 +1,5 @@
1
1
  module Lopata
2
2
  module Version
3
- STRING = '0.1.4'
3
+ STRING = '0.1.5'
4
4
  end
5
5
  end
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
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-23 00:00:00.000000000 Z
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.4
142
+ summary: lopata-0.1.5
143
143
  test_files: []