eac_tools 0.70.0 → 0.72.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +39 -38
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +1 -1
- data/sub/avm/lib/avm/applications/base.rb +1 -0
- data/sub/avm/lib/avm/instances/base/processes.rb +3 -3
- data/sub/avm/lib/avm/instances/process.rb +11 -1
- data/sub/avm/lib/avm/registry/applications.rb +7 -0
- data/sub/avm/lib/avm/registry/config_objects.rb +18 -0
- data/sub/avm/lib/avm/registry.rb +3 -2
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +2 -2
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/processes/daemon.rb +4 -0
- data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +1 -1
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/processes/web_server.rb +4 -0
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-tools/avm-tools.gemspec +3 -3
- data/sub/avm-tools/lib/avm/tools/runner/applications/list.rb +31 -0
- data/sub/avm-tools/lib/avm/tools/runner/applications.rb +16 -0
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_config/eac_config.gemspec +2 -2
- data/sub/eac_config/lib/eac_config/entries.rb +35 -0
- data/sub/eac_config/lib/eac_config/entry_path.rb +27 -0
- data/sub/eac_config/lib/eac_config/envvars_node.rb +6 -0
- data/sub/eac_config/lib/eac_config/node.rb +7 -1
- data/sub/eac_config/lib/eac_config/node_entry.rb +1 -0
- data/sub/eac_config/lib/eac_config/version.rb +1 -1
- data/sub/eac_config/lib/eac_config/yaml_file_node/self_entries.rb +72 -0
- data/sub/eac_config/lib/eac_config/yaml_file_node.rb +3 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec.rb +62 -26
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1.yaml +5 -1
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_1.yaml +2 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2/storage1_2_1.yaml +2 -0
- data/sub/eac_config/spec/lib/eac_config/yaml_file_node_spec_files/storage1_2.yaml +6 -0
- data/sub/eac_envs-http/eac_envs-http.gemspec +3 -3
- data/sub/eac_envs-http/lib/eac_envs/http/response/body.rb +5 -0
- data/sub/eac_envs-http/lib/eac_envs/http/version.rb +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/get.target.yaml +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/get_with_auth.target.yaml +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/post_array_body.target.yaml +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/post_string_body.target.yaml +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/put_hash_body.target.yaml +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/put_with_file.target.yaml +1 -1
- data/sub/eac_envs-http/spec/lib/eac_envs/http/request_spec_files/root.target.yaml +1 -1
- data/sub/eac_envs-http/spec/spec_helper/request_builder.rb +1 -0
- data/sub/eac_rest/eac_rest.gemspec +2 -2
- data/sub/eac_rest/lib/eac_rest/api.rb +1 -1
- data/sub/eac_rest/lib/eac_rest/version.rb +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/get.target.yaml +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/get_with_auth.target.yaml +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/post_array_body.target.yaml +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/post_string_body.target.yaml +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/put_hash_body.target.yaml +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/put_with_file.target.yaml +1 -1
- data/sub/eac_rest/spec/lib/eac_rest/api_spec_files/root.target.yaml +1 -1
- data/sub/eac_rest/spec/spec_helper/request_builder.rb +2 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/acts_as_instance_method.rb +34 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/gems_registry.rb +0 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/method_class.rb +7 -15
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/module/acts_as_instance_method.rb +10 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/wildcards.rb +26 -0
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/wildcards_spec.rb +27 -0
- metadata +29 -20
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_config/entry_path'
|
4
|
+
require 'eac_config/yaml_file_node/entry'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
require 'eac_ruby_utils/wildcards'
|
7
|
+
|
8
|
+
module EacConfig
|
9
|
+
class YamlFileNode
|
10
|
+
class SelfEntries
|
11
|
+
acts_as_instance_method
|
12
|
+
common_constructor :node, :path do
|
13
|
+
self.path = ::EacConfig::EntryPath.assert(path)
|
14
|
+
end
|
15
|
+
|
16
|
+
# @return [Array<EacConfig::YamlFileNode>]
|
17
|
+
def result
|
18
|
+
head_node.result.map { |found_path| ::EacConfig::YamlFileNode::Entry.new(node, found_path) }
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
# @return [DataNode]
|
24
|
+
def head_node
|
25
|
+
DataNode.new(node.data, ::EacConfig::EntryPath.new, path)
|
26
|
+
end
|
27
|
+
|
28
|
+
class DataNode
|
29
|
+
common_constructor :data_node, :path_from, :path_to do
|
30
|
+
self.data_node = data_node.stringify_keys if data_node.is_a?(::Hash)
|
31
|
+
end
|
32
|
+
|
33
|
+
# @return [DataNode]
|
34
|
+
def child(child_key)
|
35
|
+
self.class.new(data_node.fetch(child_key), path_from.with_last(child_key),
|
36
|
+
path_to.without_first)
|
37
|
+
end
|
38
|
+
|
39
|
+
def children
|
40
|
+
return [] unless data_node.is_a?(::Hash)
|
41
|
+
|
42
|
+
data_node.keys.select { |k| key_matcher.match?(k) }.map { |k| child(k) }
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [Symbol]
|
46
|
+
def key
|
47
|
+
path_to.first
|
48
|
+
end
|
49
|
+
|
50
|
+
# @return [EacRubyUtils::Wildcards]
|
51
|
+
def key_matcher
|
52
|
+
@key_matcher ||= ::EacRubyUtils::Wildcards.new(key)
|
53
|
+
end
|
54
|
+
|
55
|
+
# @return [Array<EacConfig::EntryPath>]
|
56
|
+
def result
|
57
|
+
(path_to.empty? ? result_from_self : result_from_children)
|
58
|
+
end
|
59
|
+
|
60
|
+
# @return [Array<EacConfig::EntryPath>]
|
61
|
+
def result_from_self
|
62
|
+
[path_from]
|
63
|
+
end
|
64
|
+
|
65
|
+
# @return [Array<EacConfig::EntryPath>]
|
66
|
+
def result_from_children
|
67
|
+
children.flat_map(&:result)
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -20,6 +20,7 @@ module EacConfig
|
|
20
20
|
common_constructor :path do
|
21
21
|
self.path = path.to_pathname
|
22
22
|
end
|
23
|
+
compare_by :path
|
23
24
|
|
24
25
|
def persist_data(new_data)
|
25
26
|
path.parent.mkpath
|
@@ -47,5 +48,7 @@ module EacConfig
|
|
47
48
|
|
48
49
|
r.is_a?(::Hash) ? r : {}
|
49
50
|
end
|
51
|
+
|
52
|
+
require_sub __FILE__, require_mode: :kernel
|
50
53
|
end
|
51
54
|
end
|
@@ -12,41 +12,77 @@ RSpec.describe ::EacConfig::YamlFileNode do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
let(:fixtures_dir) { ::Pathname.new(__dir__).join('yaml_file_node_spec_files') }
|
15
|
-
let(:
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
target_dir.join('storage1_2.yaml').expand_path.to_path))
|
20
|
-
r
|
15
|
+
let(:instance) { storage1 }
|
16
|
+
|
17
|
+
storages.each do |storage|
|
18
|
+
let(storage.key) { described_class.new(fixtures_dir.join(storage.subpath)) }
|
21
19
|
end
|
22
|
-
let(:instance) { described_class.new(yaml_file_path) }
|
23
20
|
|
24
|
-
|
25
|
-
|
21
|
+
describe '#entry' do
|
22
|
+
context 'with common entry' do
|
23
|
+
let(:entry) { instance.entry('common') }
|
26
24
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
25
|
+
it { expect(entry.value).to eq('AAA') }
|
26
|
+
it { expect(entry.found_node).to eq(instance) }
|
27
|
+
it { expect(entry).to be_found }
|
28
|
+
end
|
31
29
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
storages.each do |storage|
|
31
|
+
context "with entry in loaded path \"#{storage.subpath}\"" do
|
32
|
+
let(:entry) { instance.entry(storage.key) }
|
33
|
+
let(:storage_node) { send(storage.key) }
|
34
|
+
|
35
|
+
it { expect(entry).to be_a(::EacConfig::Entry) }
|
36
|
+
it { expect(entry).to be_found }
|
37
|
+
it { expect(entry.value).to eq(storage.key) }
|
38
|
+
it { expect(entry.found_node.url).to eq(storage_node.url) }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
context 'with not existing entry' do
|
43
|
+
let(:entry) { instance.entry('no_exist') }
|
36
44
|
|
37
45
|
it { expect(entry).to be_a(::EacConfig::Entry) }
|
38
|
-
it { expect(entry).to
|
39
|
-
it { expect(entry.
|
40
|
-
it { expect(entry
|
46
|
+
it { expect(entry.value).to eq(nil) }
|
47
|
+
it { expect(entry.found_node).to eq(nil) }
|
48
|
+
it { expect(entry).not_to be_found }
|
41
49
|
end
|
42
50
|
end
|
43
51
|
|
44
|
-
|
45
|
-
|
52
|
+
describe '#entries' do
|
53
|
+
context 'when search path is "common"' do
|
54
|
+
let(:path) { 'common' }
|
55
|
+
let(:actual) { instance.entries(path).node_entries }
|
56
|
+
let(:expected) { [::EacConfig::YamlFileNode::Entry.new(storage1, path)] }
|
57
|
+
|
58
|
+
it { expect(actual).to eq(expected) }
|
59
|
+
end
|
60
|
+
|
61
|
+
context 'when search path is "same.path"' do
|
62
|
+
let(:path) { 'same.path' }
|
63
|
+
let(:actual) { instance.entries(path).node_entries }
|
64
|
+
let(:expected) do
|
65
|
+
[storage1_1, storage1_2_1].map do |n|
|
66
|
+
::EacConfig::YamlFileNode::Entry.new(n, 'same.path')
|
67
|
+
end
|
68
|
+
end
|
46
69
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
70
|
+
it { expect(actual).to eq(expected) }
|
71
|
+
end
|
72
|
+
|
73
|
+
context 'when search path is "*.search_me"' do
|
74
|
+
let(:path) { '*.search_me' }
|
75
|
+
let(:actual) { instance.entries(path).node_entries }
|
76
|
+
let(:expected) do
|
77
|
+
[
|
78
|
+
[storage1, 'storage1_a'], [storage1, 'storage1_b'],
|
79
|
+
[storage1_2, 'storage1_2_a'], [storage1_2, 'storage1_2_b'], [storage1_2, 'storage1_2_c']
|
80
|
+
].map do |args|
|
81
|
+
::EacConfig::YamlFileNode::Entry.new(args[0], args[1] + '.search_me')
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it { expect(actual).to eq(expected) }
|
86
|
+
end
|
51
87
|
end
|
52
88
|
end
|
@@ -13,12 +13,12 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
15
|
s.add_dependency 'eac_fs', '~> 0.16'
|
16
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
17
|
-
s.add_dependency 'faraday', '~> 2.7', '>= 2.7.
|
16
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.117', '>= 0.117.1'
|
17
|
+
s.add_dependency 'faraday', '~> 2.7', '>= 2.7.6'
|
18
18
|
s.add_dependency 'faraday-follow_redirects', '~> 0.3'
|
19
19
|
s.add_dependency 'faraday-gzip', '~> 0.1'
|
20
20
|
s.add_dependency 'faraday-multipart', '~> 1.0', '>= 1.0.4'
|
21
|
-
s.add_dependency 'faraday-retry', '~> 2.
|
21
|
+
s.add_dependency 'faraday-retry', '~> 2.2'
|
22
22
|
|
23
23
|
s.add_development_dependency 'aranha-parsers', '~> 0.17'
|
24
24
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
|
@@ -6,7 +6,7 @@ body: "-------------RubyMultipartPost-0123456789abcdef0123456789abcdef\r\nConten
|
|
6
6
|
form-data; name=\"field1\"; filename=\"basename\"\r\nContent-Length: 6\r\nContent-Type:
|
7
7
|
text/plain\r\nContent-Transfer-Encoding: binary\r\n\r\nvalue1\r\n-------------RubyMultipartPost-0123456789abcdef0123456789abcdef--\r\n"
|
8
8
|
headers:
|
9
|
-
user-agent:
|
9
|
+
user-agent: EacEnvs::Http
|
10
10
|
content-type: multipart/form-data; boundary=-----------RubyMultipartPost-0123456789abcdef0123456789abcdef
|
11
11
|
content-length: '290'
|
12
12
|
accept-encoding: gzip,deflate
|
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'eac_envs-http', '~> 0.
|
15
|
+
s.add_dependency 'eac_envs-http', '~> 0.4'
|
16
16
|
s.add_dependency 'eac_fs', '~> 0.16'
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.117', '>= 0.117.1'
|
18
18
|
|
19
19
|
s.add_development_dependency 'aranha-parsers', '~> 0.15'
|
20
20
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
@@ -32,7 +32,7 @@ module EacRest
|
|
32
32
|
|
33
33
|
def request_json(service_url_suffix, headers = {}, &body_data_proc)
|
34
34
|
request(service_url_suffix, headers.merge('Accept' => 'application/json')) do |body_data|
|
35
|
-
r = ::JSON.parse(body_data)
|
35
|
+
r = body_data.is_a?(::Enumerable) ? body_data : ::JSON.parse(body_data)
|
36
36
|
r = body_data_proc.call(r) if body_data_proc
|
37
37
|
r
|
38
38
|
end
|
@@ -6,7 +6,7 @@ body: "-------------RubyMultipartPost-0123456789abcdef0123456789abcdef\r\nConten
|
|
6
6
|
form-data; name=\"field1\"; filename=\"basename\"\r\nContent-Length: 6\r\nContent-Type:
|
7
7
|
text/plain\r\nContent-Transfer-Encoding: binary\r\n\r\nvalue1\r\n-------------RubyMultipartPost-0123456789abcdef0123456789abcdef--\r\n"
|
8
8
|
headers:
|
9
|
-
user-agent:
|
9
|
+
user-agent: EacRest
|
10
10
|
content-type: multipart/form-data; boundary=-----------RubyMultipartPost-0123456789abcdef0123456789abcdef
|
11
11
|
content-length: '290'
|
12
12
|
accept-encoding: gzip,deflate
|
@@ -17,10 +17,11 @@ class RequestBuilder
|
|
17
17
|
self.data = data.with_indifferent_access
|
18
18
|
end
|
19
19
|
|
20
|
-
def result
|
20
|
+
def result # rubocop:disable Metrics/AbcSize
|
21
21
|
r = %i[verb headers].inject(selected_api.request(data.fetch(:url_suffix))) do |a, e|
|
22
22
|
data[e].if_present(a) { |v| a.send(e, v) }
|
23
23
|
end
|
24
|
+
r = r.header('user-agent', 'EacRest')
|
24
25
|
data[:body_data].if_present(r) { |v| r.body_data(build_body_data(v)) }
|
25
26
|
end
|
26
27
|
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'active_support/core_ext/module/introspection'
|
4
|
+
require 'eac_ruby_utils/patches/class/common_constructor'
|
5
|
+
require 'eac_ruby_utils/patches/module/module_parent'
|
6
|
+
require 'eac_ruby_utils/patches/string/inflector'
|
7
|
+
|
8
|
+
module EacRubyUtils
|
9
|
+
class ActsAsInstanceMethod
|
10
|
+
common_constructor :method_class
|
11
|
+
|
12
|
+
# @param sender_module [Module, nil]
|
13
|
+
# @return [self]
|
14
|
+
def setup(sender_module = nil)
|
15
|
+
sender_module ||= default_sender_module
|
16
|
+
the_setup = self
|
17
|
+
sender_module.define_method(method_name) do |*args, &block|
|
18
|
+
the_setup.method_class.new(self, *args, &block).result
|
19
|
+
end
|
20
|
+
|
21
|
+
self
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [String]
|
25
|
+
def method_name
|
26
|
+
method_class.name.demodulize.underscore.variableize
|
27
|
+
end
|
28
|
+
|
29
|
+
# @return [Module]
|
30
|
+
def default_sender_module
|
31
|
+
method_class.module_parent
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require '
|
3
|
+
require 'eac_ruby_utils/acts_as_instance_method'
|
4
4
|
require 'eac_ruby_utils/patches/class/common_constructor'
|
5
5
|
require 'eac_ruby_utils/patches/module/common_concern'
|
6
|
-
require 'eac_ruby_utils/patches/module/module_parent'
|
7
|
-
require 'eac_ruby_utils/patches/string/inflector'
|
8
6
|
|
9
7
|
module EacRubyUtils
|
10
8
|
module MethodClass
|
@@ -12,24 +10,18 @@ module EacRubyUtils
|
|
12
10
|
::EacRubyUtils::MethodClass::Setup.new(self)
|
13
11
|
end
|
14
12
|
|
15
|
-
class Setup
|
16
|
-
common_constructor :method_class, :static_method, default: [false]
|
13
|
+
class Setup < ::EacRubyUtils::ActsAsInstanceMethod
|
14
|
+
common_constructor :method_class, :static_method, default: [false],
|
15
|
+
super_args: -> { [method_class] } do
|
17
16
|
perform
|
18
17
|
end
|
19
18
|
|
20
19
|
def perform
|
21
|
-
|
22
|
-
sender_module.define_method(method_name) do |*args, &block|
|
23
|
-
the_setup.method_class.new(self, *args, &block).result
|
24
|
-
end
|
20
|
+
setup
|
25
21
|
end
|
26
22
|
|
27
|
-
def
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
def sender_module
|
32
|
-
r = method_class.module_parent
|
23
|
+
def default_sender_module
|
24
|
+
r = super
|
33
25
|
r = r.singleton_class if static_method
|
34
26
|
r
|
35
27
|
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module EacRubyUtils
|
4
|
+
# The `Wildcards` class provides pattern matching with wildcards using regular expressions.
|
5
|
+
class Wildcards
|
6
|
+
# Initializes a new instance of the `Wildcards` class with the specified pattern.
|
7
|
+
#
|
8
|
+
# @param pattern [String] The pattern to match against.
|
9
|
+
def initialize(pattern)
|
10
|
+
@pattern = pattern
|
11
|
+
end
|
12
|
+
|
13
|
+
# Matches the given string against the pattern.
|
14
|
+
#
|
15
|
+
# @param string [String] The string to match.
|
16
|
+
# @return [Boolean] Returns `true` if the string matches the pattern, otherwise `false`.
|
17
|
+
delegate :match?, to: :regex
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
# @return [Regexp]
|
22
|
+
def regex
|
23
|
+
::Regexp.new("^#{::Regexp.escape(@pattern).gsub('\*', '.*').gsub('\?', '.?')}$")
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/wildcards'
|
4
|
+
|
5
|
+
::RSpec.describe ::EacRubyUtils::Wildcards do
|
6
|
+
describe '#match' do
|
7
|
+
{
|
8
|
+
'h*llo' => { 'hello' => true, 'hallo' => true, 'hxllo' => true, 'hillo' => true },
|
9
|
+
'w?rld' => { 'world' => true, 'warld' => true, 'wzzrld' => false },
|
10
|
+
'h*l?o' => { 'hello' => true, 'hallo' => true, 'hxxllo' => true, 'hilbbo' => false },
|
11
|
+
'' => { '' => true, 'hello' => false },
|
12
|
+
'hello' => { '' => false, 'hello' => true }
|
13
|
+
}.each do |pattern, examples|
|
14
|
+
context "when pattern is '#{pattern}'" do
|
15
|
+
let(:instance) { described_class.new(pattern) }
|
16
|
+
|
17
|
+
examples.each do |string, expected_result|
|
18
|
+
context "when string is \"#{string}\"" do # rubocop:disable RSpec/NestedGroups
|
19
|
+
it do
|
20
|
+
expect(instance.match?(string)).to eq(expected_result)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|