anyt-core 1.4.0 → 1.4.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 158d005ccb552a059df74166a759a51fc982666cebc182b80d7dda37454c6717
4
- data.tar.gz: 8ef8e1730ec753e623be8f20eadc86b572bc6b935261e855316200d060234115
3
+ metadata.gz: 40134b310d42956b75cf92aa03fe2a8c48597f1642b086b12303dacced180cdd
4
+ data.tar.gz: 394b3e1520a0cecee8772d21cecd77a060bcb911d439824fbb0bf687b0f53c84
5
5
  SHA512:
6
- metadata.gz: 61800da6022b7e877ae71cc7a4b98a09e3e7c3cab36df7d4f03c1e8c53ec439fd27d034968ff46c634ee294ac8eed83902f05b6098710cd0174ddbdc43e7694c
7
- data.tar.gz: d78be5f00123db956c42a87aa8315b63d7b8ce52c8c5cd7fa33865ff7ce36a3408f8a6f7b11be356c081e013251e2de54dfb2339cea685745baa6a034d6d07a9
6
+ metadata.gz: 3f53c5b806abb449c7a4ef5c084a23294af5496eaf868631dbbfce9f6c6ab1a8c701a86fa78c78e4cd464a0ecb722a1982c3d2eb83c7ee01e964fc889b205a10
7
+ data.tar.gz: 4d7ad5f4ac53858d923fbde8f2ef8ee8cca026198f9eaf49661480f2e593a4ae70fbb3b7c18b7940c5a2cd0995b14574d32eb79bc377d75001c9fbf4dcb96774
data/lib/anyt/cli.rb CHANGED
@@ -145,6 +145,11 @@ module Anyt
145
145
  configure_rails_command!
146
146
  end
147
147
 
148
+ cli.on("--rails-command=COMMAND", "A custom command to run Rails server") do |cmd|
149
+ configure_rails_command!(cmd)
150
+ Anyt.config.custom_action_cable = true
151
+ end
152
+
148
153
  cli.on("--only test1,test2,test3", Array, "Run only specified tests") do |only_tests|
149
154
  Anyt.config.only_tests = only_tests
150
155
  end
@@ -168,9 +173,9 @@ module Anyt
168
173
  end
169
174
 
170
175
  cli.on("-rPATH", "--require=PATH",
171
- "Path to additional tests (e.g. features/*.rb") do |path|
172
- Anyt.config.tests_relative_path = path
173
- ENV["ANYT_TESTS_RELATIVE_PATH"] = path
176
+ "Paths to additional tests (e.g. features/*.rb") do |paths|
177
+ Anyt.config.tests_relative_path = paths
178
+ ENV["ANYT_TESTS_RELATIVE_PATH"] = paths
174
179
  end
175
180
 
176
181
  cli.on("--debug", "Enable debug mode.") do
@@ -196,8 +201,8 @@ module Anyt
196
201
  exit 1
197
202
  end
198
203
 
199
- def configure_rails_command!
200
- Anyt.config.command = RAILS_COMMAND
204
+ def configure_rails_command!(cmd = RAILS_COMMAND)
205
+ Anyt.config.command = cmd % {config: DUMMY_ROOT}
201
206
  Anyt.config.use_action_cable = true
202
207
  end
203
208
 
data/lib/anyt/command.rb CHANGED
@@ -59,6 +59,7 @@ module Anyt
59
59
  AnyCable.logger.debug "Restarting command PID: #{process.pid}"
60
60
 
61
61
  stop
62
+
62
63
  process.wait
63
64
 
64
65
  run
data/lib/anyt/config.rb CHANGED
@@ -13,6 +13,7 @@ module Anyt
13
13
  :tests_relative_path,
14
14
  remote_control_port: 8919,
15
15
  use_action_cable: false,
16
+ custom_action_cable: false,
16
17
  target_url: "ws://localhost:9292/cable",
17
18
  wait_command: 2,
18
19
  timeout_multiplier: 1
@@ -20,10 +21,12 @@ module Anyt
20
21
  coerce_types only_tests: {type: :string, array: true}
21
22
  coerce_types except_tests: {type: :string, array: true}
22
23
 
23
- def tests_path
24
+ def test_paths
24
25
  return unless tests_relative_path
25
26
 
26
- File.expand_path(tests_relative_path, Dir.pwd)
27
+ tests_relative_path.split(",").map do |path|
28
+ File.expand_path(path, Dir.pwd)
29
+ end
27
30
  end
28
31
 
29
32
  def filter_tests?
@@ -21,7 +21,7 @@ module Anyt
21
21
  end
22
22
 
23
23
  def restart_server!
24
- if Anyt.config.use_action_cable
24
+ if Anyt.config.use_action_cable && !Anyt.config.custom_action_cable
25
25
  remote_client.restart_action_cable
26
26
  else
27
27
  Command.restart
@@ -84,8 +84,8 @@ end
84
84
  # Kernel extensions
85
85
  module Kernel
86
86
  ## Wraps `describe` and include shared helpers
87
- private def feature(*args, &block)
88
- cls = describe(*args, &block)
87
+ private def feature(...)
88
+ cls = describe(...)
89
89
  cls.include Anyt::TestHelpers
90
90
  cls
91
91
  end
@@ -108,12 +108,12 @@ module Minitest::Spec::DSL
108
108
 
109
109
  # Generates Channel class dynamically and
110
110
  # add memoized helper to access its name
111
- def channel(id = nil, &block)
111
+ def channel(id = nil, &)
112
112
  class_name = @name.gsub(/\s+/, "_")
113
113
  class_name += "_#{id}" if id
114
114
  class_name += "_channel"
115
115
 
116
- cls = Class.new(ApplicationCable::Channel, &block)
116
+ cls = Class.new(ApplicationCable::Channel, &)
117
117
 
118
118
  Anyt::TestChannels.const_set(class_name.classify, cls)
119
119
 
@@ -123,8 +123,8 @@ module Minitest::Spec::DSL
123
123
  end
124
124
 
125
125
  # Add new #connect handler
126
- def connect_handler(tag, &block)
127
- Anyt::ConnectHandlers.add(tag, &block)
126
+ def connect_handler(tag, &)
127
+ Anyt::ConnectHandlers.add(tag, &)
128
128
  end
129
129
  end
130
130
 
data/lib/anyt/tests.rb CHANGED
@@ -74,7 +74,7 @@ module Anyt
74
74
 
75
75
  def test_files_patterns
76
76
  @test_files_patterns ||= DEFAULT_PATTERNS.dup.tap do |patterns|
77
- patterns << Anyt.config.tests_path if Anyt.config.tests_path
77
+ patterns.concat(Anyt.config.test_paths) if Anyt.config.test_paths
78
78
  end
79
79
  end
80
80
  end
data/lib/anyt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anyt
4
- VERSION = "1.4.0"
4
+ VERSION = "1.4.2"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anyt-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
11
+ date: 2025-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -114,8 +114,6 @@ files:
114
114
  - lib/anyt/dummy/application.rb
115
115
  - lib/anyt/dummy/config.ru
116
116
  - lib/anyt/dummy/routes.rb
117
- - lib/anyt/dummy/tmp/development_secret.txt
118
- - lib/anyt/dummy/tmp/local_secret.txt
119
117
  - lib/anyt/ext/minitest.rb
120
118
  - lib/anyt/remote_control.rb
121
119
  - lib/anyt/rpc.rb
@@ -145,7 +143,7 @@ homepage: http://github.com/anycable/anyt
145
143
  licenses:
146
144
  - MIT
147
145
  metadata: {}
148
- post_install_message:
146
+ post_install_message:
149
147
  rdoc_options: []
150
148
  require_paths:
151
149
  - lib
@@ -153,15 +151,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
153
151
  requirements:
154
152
  - - ">="
155
153
  - !ruby/object:Gem::Version
156
- version: 2.6.0
154
+ version: 3.1.0
157
155
  required_rubygems_version: !ruby/object:Gem::Requirement
158
156
  requirements:
159
157
  - - ">="
160
158
  - !ruby/object:Gem::Version
161
159
  version: '0'
162
160
  requirements: []
163
- rubygems_version: 3.5.18
164
- signing_key:
161
+ rubygems_version: 3.4.19
162
+ signing_key:
165
163
  specification_version: 4
166
164
  summary: Action Cable / AnyCable conformance testing tool
167
165
  test_files: []
@@ -1 +0,0 @@
1
- fe2ecbcf229d5547a64bcdaa9ef4e543404ca3fc9d4ee83aaa7ddab34b6a378fe090c2b1836c9ebd3e5ebbf01c239ddac95e219358baaefc1afaa04cd07bf78c
@@ -1 +0,0 @@
1
- 8e4e6bba332e819bd6597b2e8961ca1c0ef0c9bcb3401214ea22155b729e262534cefed3012024f57b098e0756baddea2d145675da33f31a0844df44c9230141