summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Graaff <hans@degraaff.org>2022-07-29 07:17:31 +0200
committerHans de Graaff <hans@degraaff.org>2022-07-29 07:17:31 +0200
commitbb439d64df44b15f4f2f9d0d5d8bde0cda261235 (patch)
tree346f0c0e6cb0f145449a1448942ec190fef69eb2 /dev-ruby/site_prism
parentdev-ruby/chroma: update USE_RUBY support (diff)
downloadgraaff-bb439d64df44b15f4f2f9d0d5d8bde0cda261235.tar.gz
graaff-bb439d64df44b15f4f2f9d0d5d8bde0cda261235.tar.bz2
graaff-bb439d64df44b15f4f2f9d0d5d8bde0cda261235.zip
dev-ruby/site_prism: enable ruby30
Signed-off-by: Hans de Graaff <hans@degraaff.org>
Diffstat (limited to 'dev-ruby/site_prism')
-rw-r--r--dev-ruby/site_prism/files/site_prism-3.7.3-kwargs1.patch63
-rw-r--r--dev-ruby/site_prism/files/site_prism-3.7.3-kwargs2.patch45
-rw-r--r--dev-ruby/site_prism/site_prism-3.7.3.ebuild4
3 files changed, 111 insertions, 1 deletions
diff --git a/dev-ruby/site_prism/files/site_prism-3.7.3-kwargs1.patch b/dev-ruby/site_prism/files/site_prism-3.7.3-kwargs1.patch
new file mode 100644
index 00000000..e48a8f30
--- /dev/null
+++ b/dev-ruby/site_prism/files/site_prism-3.7.3-kwargs1.patch
@@ -0,0 +1,63 @@
+From 457f3bf9979693cbe48389cc402414a9c6607548 Mon Sep 17 00:00:00 2001
+From: Luke Hill <lukehill_uk@hotmail.com>
+Date: Fri, 29 Apr 2022 13:01:41 +0100
+Subject: [PATCH] Fix keyword arg issue
+
+---
+ spec/site_prism/section_spec.rb | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/spec/site_prism/section_spec.rb b/spec/site_prism/section_spec.rb
+index d7bdabe..19b57b5 100644
+--- a/spec/site_prism/section_spec.rb
++++ b/spec/site_prism/section_spec.rb
+@@ -136,13 +136,13 @@
+
+ context 'when search arguments are provided during the DSL definition' do
+ it 'returns the search arguments for a section' do
+- expect(page).to receive(:_find).with('.other-section', wait: 0)
++ expect(page).to receive(:_find).with('.other-section', { wait: 0 })
+
+ page.section_with_locator
+ end
+
+ it 'ignores the `default_search_arguments`' do
+- expect(page).not_to receive(:_find).with(*default_search_arguments, wait: 0)
++ expect(page).not_to receive(:_find).with(*default_search_arguments, { wait: 0 })
+
+ page.section_with_locator
+ end
+@@ -159,13 +159,13 @@
+ end
+
+ it 'uses the default search arguments set on the section' do
+- expect(page).to receive(:_find).with(*default_search_arguments, wait: 0)
++ expect(page).to receive(:_find).with(*default_search_arguments, { wait: 0 })
+
+ page.section_using_defaults
+ end
+
+ it 'uses the default_search_arguments set on the parent if none set on section' do
+- expect(page).to receive(:_find).with(*default_search_arguments, wait: 0)
++ expect(page).to receive(:_find).with(*default_search_arguments, { wait: 0 })
+
+ page.section_using_defaults_from_parent
+ end
+@@ -253,7 +253,7 @@
+ let(:locator_args) { '.class-one' }
+
+ it 'passes in a hash of query arguments' do
+- expect(page).to receive(:_find).with(*locator_args, **query_args, wait: 0)
++ expect(page).to receive(:_find).with(*locator_args, { **query_args, wait: 0 })
+
+ page.new_section
+ end
+@@ -264,7 +264,7 @@
+ let(:locator_args) { '.class-two' }
+
+ it 'passes in an empty hash, which is then sanitized out' do
+- expect(page).to receive(:_find).with(*locator_args, **query_args, wait: 0)
++ expect(page).to receive(:_find).with(*locator_args, { **query_args, wait: 0 })
+
+ page.new_element
+ end
diff --git a/dev-ruby/site_prism/files/site_prism-3.7.3-kwargs2.patch b/dev-ruby/site_prism/files/site_prism-3.7.3-kwargs2.patch
new file mode 100644
index 00000000..74dea7ce
--- /dev/null
+++ b/dev-ruby/site_prism/files/site_prism-3.7.3-kwargs2.patch
@@ -0,0 +1,45 @@
+From c38c1435b5d808fec749b4c0a83be33051155383 Mon Sep 17 00:00:00 2001
+From: Luke Hill <lukehill_uk@hotmail.com>
+Date: Mon, 13 Jun 2022 10:50:02 +0100
+Subject: [PATCH] Use ruby 3.0 syntax in all missing places
+
+---
+ spec/site_prism/element_spec.rb | 4 ++--
+ spec/site_prism/sections_spec.rb | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/spec/site_prism/element_spec.rb b/spec/site_prism/element_spec.rb
+index 169f429..dad2aa6 100644
+--- a/spec/site_prism/element_spec.rb
++++ b/spec/site_prism/element_spec.rb
+@@ -93,7 +93,7 @@ def has_element_two?
+ .and_call_original
+ allow(page)
+ .to receive(:_find)
+- .with('a.b c.d', wait: 0)
++ .with('a.b c.d', { wait: 0 })
+ .and_return(element)
+ end
+
+@@ -114,7 +114,7 @@ def has_element_two?
+ .and_call_original
+ allow(page)
+ .to receive(:_find)
+- .with('//a[@class="b"]//c[@class="d"]', wait: 0)
++ .with('//a[@class="b"]//c[@class="d"]', { wait: 0 })
+ .and_return(element)
+ end
+
+diff --git a/spec/site_prism/sections_spec.rb b/spec/site_prism/sections_spec.rb
+index 1ddbcb6..75b4258 100644
+--- a/spec/site_prism/sections_spec.rb
++++ b/spec/site_prism/sections_spec.rb
+@@ -35,7 +35,7 @@
+ before do
+ allow(page_instance)
+ .to receive(:_all)
+- .with(*search_arguments, wait: 0)
++ .with(*search_arguments, { wait: 0 })
+ .and_return(%i[element1 element2])
+ end
+
diff --git a/dev-ruby/site_prism/site_prism-3.7.3.ebuild b/dev-ruby/site_prism/site_prism-3.7.3.ebuild
index 7d8e5c9e..63358280 100644
--- a/dev-ruby/site_prism/site_prism-3.7.3.ebuild
+++ b/dev-ruby/site_prism/site_prism-3.7.3.ebuild
@@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-USE_RUBY="ruby26 ruby27"
+USE_RUBY="ruby26 ruby27 ruby30"
RUBY_FAKEGEM_EXTRADOC="HACKING.md README.md UPGRADING.md"
@@ -21,6 +21,8 @@ KEYWORDS="~amd64"
SLOT="$(ver_cut 1)"
IUSE="doc"
+PATCHES=( "${FILESDIR}"/${P}-kwargs{1,2}.patch )
+
ruby_add_rdepend "
>=dev-ruby/addressable-2.6:0
>=dev-ruby/capybara-3.15:3