chop 0.29.0 → 0.31.0
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 +4 -4
- data/.github/workflows/ci.yml +2 -2
- data/Appraisals +4 -4
- data/gemfiles/{rails_6.1.gemfile → rails_7.2.gemfile} +1 -1
- data/lib/chop/diff.rb +4 -4
- data/lib/chop/dsl.rb +2 -2
- data/lib/chop/form.rb +6 -0
- data/lib/chop/unordered_list.rb +2 -2
- data/lib/chop/version.rb +1 -1
- data/lib/chop.rb +3 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b65edde0d356969603be409b0c528ba61a8488f1e5484657f22a818fcab4cd6
|
4
|
+
data.tar.gz: d6c0b3f90ed92cabfe004de992efbded4fb7cac266b08feeddd9bcea1937a395
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf8c33030456a4f459bd4d2adfd3cd94c940ea62546dac72c9f7143a31131195b0881967d04ed656ab55be932e60ad63e6974fd5e65c7ca6529a51827f710fe7
|
7
|
+
data.tar.gz: a98e1b094573b20418c07701c6b76d9a60a1f0bfdc435b5b64967da8ada6bb0b516f0b1cec2cc7c5b820dc14fac75d4df66334024d96d2aedf58b4ffd4939f82
|
data/.github/workflows/ci.yml
CHANGED
@@ -5,8 +5,8 @@ jobs:
|
|
5
5
|
strategy:
|
6
6
|
fail-fast: false
|
7
7
|
matrix:
|
8
|
-
gemfile: [
|
9
|
-
ruby: [
|
8
|
+
gemfile: [ rails_7.0, rails_7.1, rails_7.2 ]
|
9
|
+
ruby: [ 3.1, 3.2, 3.3 ]
|
10
10
|
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
data/Appraisals
CHANGED
data/lib/chop/diff.rb
CHANGED
@@ -5,11 +5,11 @@ require "active_support/hash_with_indifferent_access"
|
|
5
5
|
|
6
6
|
module Chop
|
7
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, errors: [], &block
|
8
|
+
def self.diff! selector, table, session: Capybara.current_session, timeout: Capybara.default_max_wait_time, errors: [], **kwargs, &block
|
9
9
|
errors += session.driver.invalid_element_errors
|
10
10
|
errors += [Cucumber::MultilineArgument::DataTable::Different]
|
11
11
|
session.document.synchronize timeout, errors: errors do
|
12
|
-
new(selector, table, session, timeout, block).diff!
|
12
|
+
new(selector, table, session, timeout, block).diff! **kwargs
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -139,11 +139,11 @@ module Chop
|
|
139
139
|
end
|
140
140
|
end
|
141
141
|
|
142
|
-
def diff! cucumber_table = table
|
142
|
+
def diff! cucumber_table = table, **kwargs
|
143
143
|
actual = to_a
|
144
144
|
# FIXME should just delegate to Cucumber's #diff!. Cucumber needs to handle empty tables better.
|
145
145
|
if !cucumber_table.raw.flatten.empty? && !actual.flatten.empty?
|
146
|
-
cucumber_table.diff! actual
|
146
|
+
cucumber_table.diff! actual, **kwargs
|
147
147
|
elsif cucumber_table.raw.flatten != actual.flatten
|
148
148
|
raise Cucumber::MultilineArgument::DataTable::Different.new(cucumber_table)
|
149
149
|
end
|
data/lib/chop/dsl.rb
CHANGED
@@ -8,7 +8,7 @@ module Chop
|
|
8
8
|
Create.create! klass, table, &block
|
9
9
|
end
|
10
10
|
|
11
|
-
def diff! selector, table, session: Capybara.current_session, as: nil, timeout: nil, &block
|
11
|
+
def diff! selector, table, session: Capybara.current_session, as: nil, timeout: nil, **kwargs, &block
|
12
12
|
class_name = if as
|
13
13
|
as.to_s
|
14
14
|
elsif selector.respond_to?(:tag_name)
|
@@ -17,7 +17,7 @@ module Chop
|
|
17
17
|
session.find(selector).tag_name
|
18
18
|
end.camelize
|
19
19
|
klass = const_get("Chop::#{class_name}")
|
20
|
-
kwargs =
|
20
|
+
kwargs[:session] = session
|
21
21
|
kwargs[:timeout] = timeout if timeout.present?
|
22
22
|
klass.diff! selector, table, **kwargs, &block
|
23
23
|
end
|
data/lib/chop/form.rb
CHANGED
@@ -100,6 +100,12 @@ module Chop
|
|
100
100
|
def fill_in!
|
101
101
|
session.select value, from: label
|
102
102
|
end
|
103
|
+
|
104
|
+
def get_value
|
105
|
+
if selected_value = field.value
|
106
|
+
field.find("option[value='#{selected_value}']").text
|
107
|
+
end
|
108
|
+
end
|
103
109
|
end
|
104
110
|
|
105
111
|
class MultipleCheckbox < Field
|
data/lib/chop/unordered_list.rb
CHANGED
data/lib/chop/version.rb
CHANGED
data/lib/chop.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "chop/version"
|
2
|
+
require "cucumber"
|
2
3
|
require "chop/create"
|
3
4
|
require "chop/table"
|
4
5
|
require "chop/definition_list"
|
@@ -15,8 +16,8 @@ module Chop
|
|
15
16
|
def self.empty_table
|
16
17
|
empty = Cucumber::MultilineArgument::DataTable.from([[]])
|
17
18
|
|
18
|
-
def empty.diff!
|
19
|
-
super
|
19
|
+
def empty.diff! other_table, **kwargs, &block
|
20
|
+
super other_table, **kwargs.reverse_merge(surplus_col: true, surplus_row: true), &block
|
20
21
|
rescue Capybara::ElementNotFound
|
21
22
|
end
|
22
23
|
|
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.
|
4
|
+
version: 0.31.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Micah Geisel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -141,9 +141,9 @@ files:
|
|
141
141
|
- bin/setup
|
142
142
|
- chop.gemspec
|
143
143
|
- gemfiles/.bundle/config
|
144
|
-
- gemfiles/rails_6.1.gemfile
|
145
144
|
- gemfiles/rails_7.0.gemfile
|
146
145
|
- gemfiles/rails_7.1.gemfile
|
146
|
+
- gemfiles/rails_7.2.gemfile
|
147
147
|
- lib/chop.rb
|
148
148
|
- lib/chop/config.rb
|
149
149
|
- lib/chop/create.rb
|