lopata 0.1.7 → 0.1.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/lopata +1 -1
- data/lib/lopata/condition.rb +2 -0
- data/lib/lopata/observers/console_output_observer.rb +1 -0
- data/lib/lopata/role.rb +20 -1
- data/lib/lopata/scenario_builder.rb +4 -2
- data/lib/lopata/step.rb +2 -0
- data/lib/lopata/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 65f89b815ebe8514f78c803eab2bd2ece867e9fcdc9c28c178a721d717fd0341
|
4
|
+
data.tar.gz: c418371982133703b0b97921fd870937052854e6975b4bb47f664105c56ed6b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d54572c90bfdaea0aa91747541016d0d0b1ac1710a9d9a54c8278861643a07f5a8ea7157206a85cbaf3f3986c0dbabd14bfa741a5ce7eb7deb6bd2917d2d6b89
|
7
|
+
data.tar.gz: 3d82e45bd0fd6c2901c65a4a07437a27df8b8367e1682a67b191f4829bb6bf2a11b583f319804e560e08774f806c675d82547bdb87fec623a1d6fb143d9d2b72
|
data/exe/lopata
CHANGED
@@ -4,7 +4,7 @@ require 'lopata/runner'
|
|
4
4
|
|
5
5
|
# use default command with arguments if given command is unknown.
|
6
6
|
argv = ARGV.dup
|
7
|
-
unless Lopata::Runner.all_commands.keys.include? argv
|
7
|
+
unless Lopata::Runner.all_commands.keys.map(&:to_s).include? argv.first
|
8
8
|
argv.unshift 'test'
|
9
9
|
end
|
10
10
|
|
data/lib/lopata/condition.rb
CHANGED
data/lib/lopata/role.rb
CHANGED
@@ -45,6 +45,24 @@ module Lopata
|
|
45
45
|
def as(*args, &block)
|
46
46
|
@roles = args.flatten
|
47
47
|
@roles << Lopata::ScenarioBuilder::CalculatedValue.new(&block) if block_given?
|
48
|
+
@use_all_roles = true
|
49
|
+
@role_options = nil
|
50
|
+
end
|
51
|
+
|
52
|
+
# Enumerate the roles the scenario can be run.
|
53
|
+
#
|
54
|
+
# The scenario should be set to use the role via before_scenario step using #current_role param.
|
55
|
+
#
|
56
|
+
# Only first role will be used if scenario has no options or diagonales. Some first roles will be used if
|
57
|
+
# options or diagonales are declared, in order of appearence.
|
58
|
+
#
|
59
|
+
# Use this to describe possible roles, but not needed to run scenario with all of them in order to save time
|
60
|
+
# of running.
|
61
|
+
#
|
62
|
+
# @param args [Array<Symbol>] list of roles the scenario to be runned with.
|
63
|
+
def as_first(*args, &block)
|
64
|
+
@roles = args.flatten
|
65
|
+
@use_all_roles = false
|
48
66
|
@role_options = nil
|
49
67
|
end
|
50
68
|
|
@@ -69,7 +87,8 @@ module Lopata
|
|
69
87
|
# @private
|
70
88
|
def build_role_options
|
71
89
|
return [] unless roles
|
72
|
-
|
90
|
+
role_variants = roles.map { |r| [Lopata.configuration.role_descriptions[r], r] }
|
91
|
+
[Lopata::ScenarioBuilder::Diagonal.new(:as, role_variants, @use_all_roles)]
|
73
92
|
end
|
74
93
|
|
75
94
|
# @private
|
@@ -448,8 +448,8 @@ class Lopata::ScenarioBuilder
|
|
448
448
|
|
449
449
|
# @private
|
450
450
|
class Option
|
451
|
-
attr_reader :variants, :key
|
452
|
-
def initialize(key, variants)
|
451
|
+
attr_reader :variants, :key, :use_all_variants
|
452
|
+
def initialize(key, variants, use_all_variants = true)
|
453
453
|
@key = key
|
454
454
|
@variants =
|
455
455
|
if variants.is_a? Hash
|
@@ -458,6 +458,7 @@ class Lopata::ScenarioBuilder
|
|
458
458
|
# Array of arrays of two elements
|
459
459
|
variants.map { |v| Variant.new(self, key, *v) }
|
460
460
|
end
|
461
|
+
@use_all_variants = use_all_variants
|
461
462
|
end
|
462
463
|
|
463
464
|
# Variants to apply at one level
|
@@ -469,6 +470,7 @@ class Lopata::ScenarioBuilder
|
|
469
470
|
@current ||= 0
|
470
471
|
selected_variant = variants[@current]
|
471
472
|
@current += 1
|
473
|
+
@complete = true unless use_all_variants # not need to verify all variants, just use first ones.
|
472
474
|
if @current >= variants.length
|
473
475
|
@current = 0
|
474
476
|
@complete = true # all variants have been selected
|
data/lib/lopata/step.rb
CHANGED
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.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexey Volochnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.18.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.18.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,5 +138,5 @@ requirements: []
|
|
138
138
|
rubygems_version: 3.0.3
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
|
-
summary: lopata-0.1.
|
141
|
+
summary: lopata-0.1.12
|
142
142
|
test_files: []
|