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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f84ec9d448ef83b5f8d68adbf9a1c550b0a562a97d8fad772cae9c5e7549c73
4
- data.tar.gz: d626cb0101cdbff7d412c26674ebaa7570672f18d4f1a543a192a7bf69eca1e9
3
+ metadata.gz: e7abe69b089b6ecea7a858c4f3b8976836898cb4059272ea0cf75564478c55ec
4
+ data.tar.gz: 3cb9b264816068b341a25dc31f64a6720c3342fa147e65226f2f40855f581ad3
5
5
  SHA512:
6
- metadata.gz: fa66bb7aacdce2c7bdbb224ad879d28c29236768a6a586d488e181f4455446a51e86de45320c5f2508613a16bbc31a6b422b6c744b589842a0a292b3a50a3c90
7
- data.tar.gz: 5f896840ea326efaa236f32a9e60e717cb31fde302dbcd157be4c72de5cec9f07c1be9e18dfcbffa28e703eaf850dbe405e9f061969f54215b1427d38ad05f04
6
+ metadata.gz: 43fe87ba581cdcc8a53d1f0e52f8f8a8de20fc7254ec00326e669c41e3fd999014c9fc29d91b93d52c65ec68a35aa42448aacc445521de91ad44da30ba70c8d5
7
+ data.tar.gz: 15f0337c814421702e794364e2fb1f038bd024cdfab7092bad0119e0b749ffb5d2368a2956352014bd7d0175c91cbaa539a26f8b620c3982ed1a24791d35ac21
@@ -5,8 +5,8 @@ jobs:
5
5
  strategy:
6
6
  fail-fast: false
7
7
  matrix:
8
- gemfile: [ rails_6.1, rails_7.0, rails_7.1 ]
9
- ruby: [ '3.0', 3.1, 3.2 ]
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
@@ -1,7 +1,3 @@
1
- appraise "rails-6.1" do
2
- gem "rails", "~>6.1.0"
3
- end
4
-
5
1
  appraise "rails-7.0" do
6
2
  gem "rails", "~>7.0.0"
7
3
  end
@@ -10,3 +6,7 @@ appraise "rails-7.1" do
10
6
  gem "rails", "~>7.1.0"
11
7
  end
12
8
 
9
+ appraise "rails-7.2" do
10
+ gem "rails", "~>7.2.0"
11
+ end
12
+
@@ -5,6 +5,6 @@ source "https://rubygems.org"
5
5
  gem "byebug"
6
6
  gem "puma", "~>5.0"
7
7
  gem "rack", "~>2.0"
8
- gem "rails", "~>6.1.0"
8
+ gem "rails", "~>7.2.0"
9
9
 
10
10
  gemspec path: "../"
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 = { session: session }
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
@@ -1,3 +1,3 @@
1
1
  module Chop
2
- VERSION = "0.29.0"
2
+ VERSION = "0.30.0"
3
3
  end
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.29.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-07-11 00:00:00.000000000 Z
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