chop 0.27.0 → 0.28.1

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: 06dae0b0190a3ec10f90abda7f5e19d5c8cc46d8c34850d800b7fd13687b9c4c
4
- data.tar.gz: 18364b86f246ac84c09864121323af7d1d56d4bb12e2869519d4086050853a04
3
+ metadata.gz: f6ba456da0a548764f1a18e69630fe483b74ba5f4011c4f2f0468f63425e6a16
4
+ data.tar.gz: 0b7ddf32ce0881dc3fea0ab5360dc6f9140b07a819b26c648de400b777938742
5
5
  SHA512:
6
- metadata.gz: 55591167c97f7305a483083fa51ae51a7fa619a19b22e670ded3ef50af3e5405c177a5da422f32e2ec1f2a1e5b04c3260296f11873479881b319f794bcc3f08f
7
- data.tar.gz: f7c4ee1dfbfdf7908137c051b98d1ad8ae46987df16b9a70508247c72c1c844279d5c376b858f164c1a7426fbf8451ad62f49d1f24f84cd0c7f110a47d34ce60
6
+ metadata.gz: 7bf304ee6020e23edda9a226fa4dbde24a23ba8a7cd0e4e098eb024da1e90ea89e552515c751bcf347d96dd7bed41ec49199478501d852eb2f61b3a95bc956b3
7
+ data.tar.gz: 51dbb0ca6ec2295305349948418cfb0c56a8ffeedad2570b444053da19a300ff60600a94108667d12c902c342fe066638c7d185e030953c93adb2be98bc7550c
@@ -5,17 +5,8 @@ jobs:
5
5
  strategy:
6
6
  fail-fast: false
7
7
  matrix:
8
- gemfile: [ rails_5.1, rails_5.2, rails_6.0, rails_6.1, rails_7.0 ]
9
- ruby: [ 2.5, 2.6, 2.7, '3.0' ]
10
- exclude:
11
- - gemfile: rails_5.1
12
- ruby: 3.0
13
- - gemfile: rails_5.2
14
- ruby: 3.0
15
- - gemfile: rails_7.0
16
- ruby: 2.5
17
- - gemfile: rails_7.0
18
- ruby: 2.6
8
+ gemfile: [ rails_6.1, rails_7.0, rails_7.1 ]
9
+ ruby: [ '3.0', 3.1, 3.2 ]
19
10
 
20
11
  runs-on: ubuntu-latest
21
12
  env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
data/.gitignore CHANGED
@@ -1,6 +1,7 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
3
  /Gemfile.lock
4
+ /gemfiles/*.lock
4
5
  /_yardoc/
5
6
  /coverage/
6
7
  /doc/
data/Appraisals CHANGED
@@ -1,24 +1,12 @@
1
- appraise "rails-5.1" do
2
- gem "rails", "~>5.1.0"
3
- gem "capybara", "~>3.35.0" # 3.36 requires ruby 2.6+
4
- end
5
-
6
- appraise "rails-5.2" do
7
- gem "rails", "~>5.2.0"
8
- gem "capybara", "~>3.35.0" # 3.36 requires ruby 2.6+
9
- end
10
-
11
- appraise "rails-6.0" do
12
- gem "rails", "~>6.0.0"
13
- gem "capybara", "~>3.35.0" # 3.36 requires ruby 2.6+
14
- end
15
-
16
1
  appraise "rails-6.1" do
17
2
  gem "rails", "~>6.1.0"
18
- gem "capybara", "~>3.35.0" # 3.36 requires ruby 2.6+
19
3
  end
20
4
 
21
5
  appraise "rails-7.0" do
22
6
  gem "rails", "~>7.0.0"
23
7
  end
24
8
 
9
+ appraise "rails-7.1" do
10
+ gem "rails", "~>7.1.0"
11
+ end
12
+
data/Gemfile CHANGED
@@ -4,5 +4,6 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem "byebug"
7
- gem "webrick"
7
+ gem "puma", "~>5.0"
8
+ gem "rack", "~>2.0"
8
9
 
@@ -3,8 +3,8 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "byebug"
6
- gem "webrick"
6
+ gem "puma", "~>5.0"
7
+ gem "rack", "~>2.0"
7
8
  gem "rails", "~>6.1.0"
8
- gem "capybara", "~>3.35.0"
9
9
 
10
10
  gemspec path: "../"
@@ -3,7 +3,8 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "byebug"
6
- gem "webrick"
6
+ gem "puma", "~>5.0"
7
+ gem "rack", "~>2.0"
7
8
  gem "rails", "~>7.0.0"
8
9
 
9
10
  gemspec path: "../"
@@ -3,8 +3,8 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "byebug"
6
- gem "webrick"
7
- gem "rails", "~>5.1.0"
8
- gem "capybara", "~>3.35.0"
6
+ gem "puma", "~>5.0"
7
+ gem "rack", "~>2.0"
8
+ gem "rails", "~>7.1.0"
9
9
 
10
10
  gemspec path: "../"
data/lib/chop/diff.rb CHANGED
@@ -4,9 +4,9 @@ require "active_support/core_ext/class/attribute"
4
4
  require "active_support/hash_with_indifferent_access"
5
5
 
6
6
  module Chop
7
- class Diff < Struct.new(:selector, :table, :session, :block)
8
- def self.diff! selector, table, session: Capybara.current_session, &block
9
- new(selector, table, session, block).diff!
7
+ class Diff < Struct.new(:selector, :table, :session, :timeout, :block)
8
+ def self.diff! selector, table, session: Capybara.current_session, timeout: Capybara.default_max_wait_time, &block
9
+ new(selector, table, session, timeout, block).diff!
10
10
  end
11
11
 
12
12
  def cell_to_image_filename cell
@@ -23,7 +23,7 @@ module Chop
23
23
 
24
24
  attr_accessor :header_transformations, :transformations
25
25
 
26
- def initialize selector = nil, table = nil, session = Capybara.current_session, block = nil, &other_block
26
+ def initialize selector = nil, table = nil, session = Capybara.current_session, timeout = Capybara.default_max_wait_time, block = nil, &other_block
27
27
  super
28
28
  self.selector ||= default_selector
29
29
  self.header_transformations = []
@@ -160,7 +160,7 @@ module Chop
160
160
  if selector.is_a?(Capybara::Node::Element)
161
161
  selector
162
162
  else
163
- session.find(selector)
163
+ session.find(selector, wait: timeout)
164
164
  end
165
165
  rescue Capybara::ElementNotFound
166
166
  raise unless @allow_not_found
data/lib/chop/dsl.rb CHANGED
@@ -2,11 +2,13 @@ require "active_support/inflector"
2
2
 
3
3
  module Chop
4
4
  module DSL
5
+ extend self
6
+
5
7
  def create! klass, table, &block
6
8
  Create.create! klass, table, &block
7
9
  end
8
10
 
9
- def diff! selector, table, session: Capybara.current_session, as: nil, &block
11
+ def diff! selector, table, session: Capybara.current_session, as: nil, timeout: nil, &block
10
12
  class_name = if as
11
13
  as.to_s
12
14
  elsif selector.respond_to?(:tag_name)
@@ -15,32 +17,34 @@ module Chop
15
17
  session.find(selector).tag_name
16
18
  end.camelize
17
19
  klass = const_get("Chop::#{class_name}")
18
- klass.diff! selector, table, session: session, &block
20
+ kwargs = { session: session }
21
+ kwargs[:timeout] = timeout if timeout.present?
22
+ klass.diff! selector, table, **kwargs, &block
19
23
  end
20
24
 
21
25
  def fill_in! table
22
26
  Form.fill_in! table
23
27
  end
24
28
  end
25
- end
26
29
 
27
- if defined?(Cucumber::MultilineArgument::DataTable)
28
- Cucumber::MultilineArgument::DataTable.prepend Module.new {
29
- def create! klass, &block
30
- Chop.create! klass, self, &block
31
- end
30
+ if defined?(Cucumber::MultilineArgument::DataTable)
31
+ Cucumber::MultilineArgument::DataTable.prepend Module.new {
32
+ def create! klass, &block
33
+ DSL.create! klass, self, &block
34
+ end
32
35
 
33
- def diff! other_table="table", **kwargs, &block
34
- if other_table.respond_to?(:tag_name) || (other_table.is_a?(String) && !other_table.include?("|"))
35
- Chop.diff! other_table, self, **kwargs, &block
36
- else
37
- super
36
+ def diff! other_table="table", **kwargs, &block
37
+ if other_table.respond_to?(:tag_name) || (other_table.is_a?(String) && !other_table.include?("|"))
38
+ DSL.diff! other_table, self, **kwargs, &block
39
+ else
40
+ super
41
+ end
38
42
  end
39
- end
40
43
 
41
- def fill_in!
42
- Chop.fill_in! self
43
- end
44
- }
44
+ def fill_in!
45
+ DSL.fill_in! self
46
+ end
47
+ }
48
+ end
45
49
  end
46
50
 
data/lib/chop/form.rb CHANGED
@@ -40,9 +40,9 @@ module Chop
40
40
 
41
41
  def self.find_label_for field, session: Capybara.current_session
42
42
  if field[:id].present?
43
- session.first("label[for='#{field[:id]}']", visible: :all)
43
+ session.first("label[for='#{field[:id]}']", visible: :all, minimum: 0, wait: 0.1)
44
44
  else
45
- raise "cannot find label without id... yet"
45
+ puts "cannot find label without id for #{field[:name]}"
46
46
  end
47
47
  end
48
48
 
data/lib/chop/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Chop
2
- VERSION = "0.27.0"
2
+ VERSION = "0.28.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.28.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-07-20 00:00:00.000000000 Z
11
+ date: 2024-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -141,16 +141,9 @@ files:
141
141
  - bin/setup
142
142
  - chop.gemspec
143
143
  - gemfiles/.bundle/config
144
- - gemfiles/rails_5.1.gemfile
145
- - gemfiles/rails_5.1.gemfile.lock
146
- - gemfiles/rails_5.2.gemfile
147
- - gemfiles/rails_5.2.gemfile.lock
148
- - gemfiles/rails_6.0.gemfile
149
- - gemfiles/rails_6.0.gemfile.lock
150
144
  - gemfiles/rails_6.1.gemfile
151
- - gemfiles/rails_6.1.gemfile.lock
152
145
  - gemfiles/rails_7.0.gemfile
153
- - gemfiles/rails_7.0.gemfile.lock
146
+ - gemfiles/rails_7.1.gemfile
154
147
  - lib/chop.rb
155
148
  - lib/chop/config.rb
156
149
  - lib/chop/create.rb
@@ -181,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
174
  - !ruby/object:Gem::Version
182
175
  version: '0'
183
176
  requirements: []
184
- rubygems_version: 3.2.32
177
+ rubygems_version: 3.5.3
185
178
  signing_key:
186
179
  specification_version: 4
187
180
  summary: Slice and dice your cucumber tables with ease!
@@ -1,216 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- chop (0.27.0)
5
- activerecord
6
- capybara
7
- cucumber
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (5.1.7)
13
- actionpack (= 5.1.7)
14
- nio4r (~> 2.0)
15
- websocket-driver (~> 0.6.1)
16
- actionmailer (5.1.7)
17
- actionpack (= 5.1.7)
18
- actionview (= 5.1.7)
19
- activejob (= 5.1.7)
20
- mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 2.0)
22
- actionpack (5.1.7)
23
- actionview (= 5.1.7)
24
- activesupport (= 5.1.7)
25
- rack (~> 2.0)
26
- rack-test (>= 0.6.3)
27
- rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.1.7)
30
- activesupport (= 5.1.7)
31
- builder (~> 3.1)
32
- erubi (~> 1.4)
33
- rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.1.7)
36
- activesupport (= 5.1.7)
37
- globalid (>= 0.3.6)
38
- activemodel (5.1.7)
39
- activesupport (= 5.1.7)
40
- activerecord (5.1.7)
41
- activemodel (= 5.1.7)
42
- activesupport (= 5.1.7)
43
- arel (~> 8.0)
44
- activesupport (5.1.7)
45
- concurrent-ruby (~> 1.0, >= 1.0.2)
46
- i18n (>= 0.7, < 2)
47
- minitest (~> 5.1)
48
- tzinfo (~> 1.1)
49
- addressable (2.8.0)
50
- public_suffix (>= 2.0.2, < 5.0)
51
- appraisal (2.4.1)
52
- bundler
53
- rake
54
- thor (>= 0.14.0)
55
- arel (8.0.0)
56
- builder (3.2.4)
57
- byebug (11.1.3)
58
- capybara (3.35.3)
59
- addressable
60
- mini_mime (>= 0.1.3)
61
- nokogiri (~> 1.8)
62
- rack (>= 1.6.0)
63
- rack-test (>= 0.6.3)
64
- regexp_parser (>= 1.5, < 3.0)
65
- xpath (~> 3.2)
66
- cliver (0.3.2)
67
- concurrent-ruby (1.1.9)
68
- crass (1.0.6)
69
- cucumber (7.1.0)
70
- builder (~> 3.2, >= 3.2.4)
71
- cucumber-core (~> 10.1, >= 10.1.0)
72
- cucumber-create-meta (~> 6.0, >= 6.0.1)
73
- cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
74
- cucumber-gherkin (~> 22.0, >= 22.0.0)
75
- cucumber-html-formatter (~> 17.0, >= 17.0.0)
76
- cucumber-messages (~> 17.1, >= 17.1.1)
77
- cucumber-wire (~> 6.2, >= 6.2.0)
78
- diff-lcs (~> 1.4, >= 1.4.4)
79
- mime-types (~> 3.3, >= 3.3.1)
80
- multi_test (~> 0.1, >= 0.1.2)
81
- sys-uname (~> 1.2, >= 1.2.2)
82
- cucumber-core (10.1.0)
83
- cucumber-gherkin (~> 22.0, >= 22.0.0)
84
- cucumber-messages (~> 17.1, >= 17.1.1)
85
- cucumber-tag-expressions (~> 4.0, >= 4.0.2)
86
- cucumber-create-meta (6.0.4)
87
- cucumber-messages (~> 17.1, >= 17.1.1)
88
- sys-uname (~> 1.2, >= 1.2.2)
89
- cucumber-cucumber-expressions (14.0.0)
90
- cucumber-gherkin (22.0.0)
91
- cucumber-messages (~> 17.1, >= 17.1.1)
92
- cucumber-html-formatter (17.0.0)
93
- cucumber-messages (~> 17.1, >= 17.1.0)
94
- cucumber-messages (17.1.1)
95
- cucumber-tag-expressions (4.1.0)
96
- cucumber-wire (6.2.0)
97
- cucumber-core (~> 10.1, >= 10.1.0)
98
- cucumber-cucumber-expressions (~> 14.0, >= 14.0.0)
99
- cucumber-messages (~> 17.1, >= 17.1.1)
100
- cuprite (0.13)
101
- capybara (>= 2.1, < 4)
102
- ferrum (~> 0.11.0)
103
- diff-lcs (1.5.0)
104
- erubi (1.10.0)
105
- ferrum (0.11)
106
- addressable (~> 2.5)
107
- cliver (~> 0.3)
108
- concurrent-ruby (~> 1.1)
109
- websocket-driver (>= 0.6, < 0.8)
110
- ffi (1.15.4)
111
- globalid (1.0.0)
112
- activesupport (>= 5.0)
113
- i18n (1.8.11)
114
- concurrent-ruby (~> 1.0)
115
- loofah (2.13.0)
116
- crass (~> 1.0.2)
117
- nokogiri (>= 1.5.9)
118
- mail (2.7.1)
119
- mini_mime (>= 0.1.1)
120
- method_source (1.0.0)
121
- mime-types (3.4.1)
122
- mime-types-data (~> 3.2015)
123
- mime-types-data (3.2021.1115)
124
- mini_mime (1.1.2)
125
- mini_portile2 (2.6.1)
126
- minitest (5.15.0)
127
- multi_test (0.1.2)
128
- nio4r (2.5.8)
129
- nokogiri (1.12.5)
130
- mini_portile2 (~> 2.6.1)
131
- racc (~> 1.4)
132
- public_suffix (4.0.6)
133
- racc (1.6.0)
134
- rack (2.2.3)
135
- rack-test (1.1.0)
136
- rack (>= 1.0, < 3)
137
- rails (5.1.7)
138
- actioncable (= 5.1.7)
139
- actionmailer (= 5.1.7)
140
- actionpack (= 5.1.7)
141
- actionview (= 5.1.7)
142
- activejob (= 5.1.7)
143
- activemodel (= 5.1.7)
144
- activerecord (= 5.1.7)
145
- activesupport (= 5.1.7)
146
- bundler (>= 1.3.0)
147
- railties (= 5.1.7)
148
- sprockets-rails (>= 2.0.0)
149
- rails-dom-testing (2.0.3)
150
- activesupport (>= 4.2.0)
151
- nokogiri (>= 1.6)
152
- rails-html-sanitizer (1.4.2)
153
- loofah (~> 2.3)
154
- railties (5.1.7)
155
- actionpack (= 5.1.7)
156
- activesupport (= 5.1.7)
157
- method_source
158
- rake (>= 0.8.7)
159
- thor (>= 0.18.1, < 2.0)
160
- rake (13.0.6)
161
- regexp_parser (2.2.0)
162
- rspec (3.10.0)
163
- rspec-core (~> 3.10.0)
164
- rspec-expectations (~> 3.10.0)
165
- rspec-mocks (~> 3.10.0)
166
- rspec-core (3.10.1)
167
- rspec-support (~> 3.10.0)
168
- rspec-expectations (3.10.1)
169
- diff-lcs (>= 1.2.0, < 2.0)
170
- rspec-support (~> 3.10.0)
171
- rspec-mocks (3.10.2)
172
- diff-lcs (>= 1.2.0, < 2.0)
173
- rspec-support (~> 3.10.0)
174
- rspec-support (3.10.3)
175
- slim (4.1.0)
176
- temple (>= 0.7.6, < 0.9)
177
- tilt (>= 2.0.6, < 2.1)
178
- sprockets (4.0.2)
179
- concurrent-ruby (~> 1.0)
180
- rack (> 1, < 3)
181
- sprockets-rails (3.2.2)
182
- actionpack (>= 4.0)
183
- activesupport (>= 4.0)
184
- sprockets (>= 3.0.0)
185
- sys-uname (1.2.2)
186
- ffi (~> 1.1)
187
- temple (0.8.2)
188
- thor (1.1.0)
189
- thread_safe (0.3.6)
190
- tilt (2.0.10)
191
- tzinfo (1.2.9)
192
- thread_safe (~> 0.1)
193
- webrick (1.7.0)
194
- websocket-driver (0.6.5)
195
- websocket-extensions (>= 0.1.0)
196
- websocket-extensions (0.1.5)
197
- xpath (3.2.0)
198
- nokogiri (~> 1.8)
199
-
200
- PLATFORMS
201
- ruby
202
-
203
- DEPENDENCIES
204
- appraisal
205
- byebug
206
- capybara (~> 3.35.0)
207
- chop!
208
- cuprite
209
- rails (~> 5.1.0)
210
- rake
211
- rspec
212
- slim
213
- webrick
214
-
215
- BUNDLED WITH
216
- 2.2.32
@@ -1,10 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "byebug"
6
- gem "webrick"
7
- gem "rails", "~>5.2.0"
8
- gem "capybara", "~>3.35.0"
9
-
10
- gemspec path: "../"