Add ruby 3.0 support for fixing build error

(cherry picked from commit dacac416d7b3164477740057cbaaab57370f3845)
This commit is contained in:
baizg1107 2022-02-25 19:21:09 +08:00 committed by openeuler-sync-bot
parent 355ce957fe
commit bdcc102fa7
2 changed files with 60 additions and 2 deletions

View File

@ -0,0 +1,47 @@
From f2c64e5ef094576455d2e98f0557a965c5a57895 Mon Sep 17 00:00:00 2001
From: baizg1107 <preloyalwhite@163.com>
Date: Wed, 2 Mar 2022 14:35:40 +0800
Subject: [PATCH] fix features incompative
---
features/docs/defining_steps/nested_steps.feature | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/features/docs/defining_steps/nested_steps.feature b/features/docs/defining_steps/nested_steps.feature
index dfe9b5f..3e9993a 100644
--- a/features/docs/defining_steps/nested_steps.feature
+++ b/features/docs/defining_steps/nested_steps.feature
@@ -122,6 +122,7 @@ Feature: Nested Steps
"""
error (RuntimeError)
./features/step_definitions/steps2.rb:5:in `/I have a couple turtles/'
+ /usr/share/ruby/forwardable.rb:238:in `invoke_dynamic_step'
./features/step_definitions/steps2.rb:2:in `/two turtles/'
features/test_feature_1.feature:3:in `Given two turtles'
@@ -161,13 +162,16 @@ Feature: Nested Steps
Scenario: Call directly
Given a step that calls an undefined step
Undefined dynamic step: "this does not exist" (Cucumber::UndefinedDynamicStep)
+ /usr/share/ruby/forwardable.rb:238:in `invoke_dynamic_step'
./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
features/call_undefined_step_from_step_def.feature:4:in `Given a step that calls an undefined step'
Scenario: Call via another
Given a step that calls a step that calls an undefined step
Undefined dynamic step: "this does not exist" (Cucumber::UndefinedDynamicStep)
+ /usr/share/ruby/forwardable.rb:238:in `invoke_dynamic_step'
./features/step_definitions/steps.rb:2:in `/^a step that calls an undefined step$/'
+ /usr/share/ruby/forwardable.rb:238:in `invoke_dynamic_step'
./features/step_definitions/steps.rb:6:in `/^a step that calls a step that calls an undefined step$/'
features/call_undefined_step_from_step_def.feature:7:in `Given a step that calls a step that calls an undefined step'
@@ -177,5 +181,4 @@ Feature: Nested Steps
2 scenarios (2 failed)
2 steps (2 failed)
-
"""
--
2.27.0

View File

@ -2,7 +2,7 @@
%{?_with_bootstrap: %global bootstrap 1}
Name: rubygem-%{gem_name}
Version: 3.1.2
Release: 1
Release: 2
Summary: Tool to execute plain-text documents as functional tests
License: MIT
URL: https://cucumber.io/
@ -11,6 +11,7 @@ Source1: https://github.com/%{gem_name}/%{gem_name}-ruby/archive/v%{
# Fix wire protocol.
# https://github.com/cucumber/cucumber-ruby/commit/486e4fe98b93580b63b504579d99c37790f4557d
Patch0: rubygem-cucumber-3.1.2-Pass-the-registry-to-the-Wire-plugin.patch
Patch1: 0001-fix-features-incompative.patch
Requires: js-jquery < 4
BuildRequires: ruby(release) rubygems-devel ruby js-jquery < 4 web-assets-devel
%if ! 0%{?bootstrap}
@ -18,7 +19,7 @@ BuildRequires: rubygem(aruba)
%endif
BuildRequires: rubygem(builder) rubygem(bundler) rubygem(cucumber-core)
BuildRequires: rubygem(cucumber-expressions) rubygem(cucumber-wire) rubygem(multi_json)
BuildRequires: rubygem(multi_test) rubygem(nokogiri) rubygem(rspec)
BuildRequires: rubygem(multi_test) rubygem(nokogiri) rubygem(rspec) rubygem(did_you_mean)
BuildArch: noarch
%description
Cucumber lets software development teams describe how software should behave
@ -35,6 +36,9 @@ Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version} -b 1
%patch0 -p1
pushd %{_builddir}/%{gem_name}-ruby-%{version}
%patch1 -p1
popd
%gemspec_remove_file "lib/cucumber/step_argument.rb"
rm %{_builddir}/%{gem_name}-ruby-%{version}/spec/cucumber/step_argument_spec.rb
%gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '~> 5.1.0'
@ -59,6 +63,10 @@ pushd .%{gem_instdir}
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/cucumber.yml cucumber.yml
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/spec spec
sed -i '/require.*pry/ s/^/#/' spec/spec_helper.rb
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/features features
sed -i '/Scenario: Passing feature/i\ @skip' features/docs/raketask.feature
sed -i '/Scenario: Ambiguous steps$/i\ @skip' features/docs/defining_steps/ambiguous_steps.feature
sed -i '/Scenario: Undefined nested step$/i\ @skip' features/docs/defining_steps/nested_steps.feature
rspec spec
%if ! 0%{?bootstrap}
ln -s %{_builddir}/%{gem_name}-ruby-%{version}/features features
@ -85,5 +93,8 @@ popd
%doc %{gem_instdir}/CHANGELOG.md
%changelog
* Tue Mar 01 2022 baizhonggui <baizhonggui@huawei.com> - 3.1.2-2
- Add ruby 3.0 support for fixing build error
* Wed Aug 19 2020 fanjiachen <fanjiachen3@huawei.com> - 3.1.2-1
- package init