chop 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- 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/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: e7abe69b089b6ecea7a858c4f3b8976836898cb4059272ea0cf75564478c55ec
|
4
|
+
data.tar.gz: 3cb9b264816068b341a25dc31f64a6720c3342fa147e65226f2f40855f581ad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43fe87ba581cdcc8a53d1f0e52f8f8a8de20fc7254ec00326e669c41e3fd999014c9fc29d91b93d52c65ec68a35aa42448aacc445521de91ad44da30ba70c8d5
|
7
|
+
data.tar.gz: 15f0337c814421702e794364e2fb1f038bd024cdfab7092bad0119e0b749ffb5d2368a2956352014bd7d0175c91cbaa539a26f8b620c3982ed1a24791d35ac21
|
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/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.30.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-09-11 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
|