Fix wire protocol.

epel9
Vít Ondruch 6 years ago
parent 2bfd103993
commit bc4de2d708

@ -0,0 +1,70 @@
From 486e4fe98b93580b63b504579d99c37790f4557d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= <B.Rasmusson@computer.org>
Date: Mon, 23 Jul 2018 13:35:05 +0200
Subject: [PATCH] Pass the registry to the Wire plugin.
Also, the class StepArgument is only used in the Wire plugin, so move
it to Cucumber-Wire.
---
lib/cucumber/glue/step_definition.rb | 1 -
lib/cucumber/runtime.rb | 2 +-
lib/cucumber/step_argument.rb | 25 --------------------------
3 files changed, 1 insertion(+), 27 deletions(-)
delete mode 100644 lib/cucumber/step_argument.rb
diff --git a/lib/cucumber/glue/step_definition.rb b/lib/cucumber/glue/step_definition.rb
index 81b3630b4..a8f43c0f2 100644
--- a/lib/cucumber/glue/step_definition.rb
+++ b/lib/cucumber/glue/step_definition.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require 'cucumber/step_match'
-require 'cucumber/step_argument'
require 'cucumber/core_ext/string'
require 'cucumber/glue/invoke_in_world'
diff --git a/lib/cucumber/runtime.rb b/lib/cucumber/runtime.rb
index fa9f88e0d..f60cf64b9 100644
--- a/lib/cucumber/runtime.rb
+++ b/lib/cucumber/runtime.rb
@@ -273,7 +273,7 @@ def load_step_definitions
end
def install_wire_plugin
- Cucumber::Wire::Plugin.new(@configuration).install if @configuration.all_files_to_load.any? { |f| f =~ %r{\.wire$} }
+ Cucumber::Wire::Plugin.new(@configuration, @support_code.registry).install if @configuration.all_files_to_load.any? { |f| f =~ /\.wire$/ }
end
def log
diff --git a/lib/cucumber/step_argument.rb b/lib/cucumber/step_argument.rb
deleted file mode 100644
index c5d0cf076..000000000
--- a/lib/cucumber/step_argument.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-# frozen_string_literal: true
-
-module Cucumber
- # Defines the location and value of a captured argument from the step
- # text
- class StepArgument
- def self.arguments_from(regexp, step_name)
- match = regexp.match(step_name)
- if match
- n = 0
- match.captures.map do |val|
- n += 1
- offset = match.offset(n)[0]
- new(offset, val)
- end
- end
- end
-
- attr_reader :offset, :val
-
- def initialize(offset, val)
- @offset, @val = offset, val
- end
- end
-end

@ -4,7 +4,7 @@
Name: rubygem-%{gem_name} Name: rubygem-%{gem_name}
Version: 3.1.2 Version: 3.1.2
Release: 1%{?dist} Release: 2%{?dist}
Summary: Tool to execute plain-text documents as functional tests Summary: Tool to execute plain-text documents as functional tests
Group: Development/Languages Group: Development/Languages
License: MIT License: MIT
@ -16,6 +16,9 @@ Source1: %{name}-%{version}-spec.tar.gz
# git clone https://github.com/cucumber/cucumber-ruby.git && cd cucumber-ruby # git clone https://github.com/cucumber/cucumber-ruby.git && cd cucumber-ruby
# git checkout v3.1.2 && tar czvf rubygem-cucumber-3.1.2-features.tar.gz features/ # git checkout v3.1.2 && tar czvf rubygem-cucumber-3.1.2-features.tar.gz features/
Source2: %{name}-%{version}-features.tar.gz Source2: %{name}-%{version}-features.tar.gz
# 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
Requires: js-jquery < 4 Requires: js-jquery < 4
BuildRequires: ruby(release) BuildRequires: ruby(release)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
@ -55,6 +58,9 @@ Documentation for %{name}.
%prep %prep
%setup -q -n %{gem_name}-%{version} -b 1 -b 2 %setup -q -n %{gem_name}-%{version} -b 1 -b 2
%patch0 -p1
%gemspec_remove_file "lib/cucumber/step_argument.rb"
# We don't have gherkin 5.1.0 in Fedora yet # We don't have gherkin 5.1.0 in Fedora yet
%gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '~> 5.1.0' %gemspec_remove_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '~> 5.1.0'
%gemspec_add_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '>= 4.1.0' %gemspec_add_dep -s ../%{gem_name}-%{version}.gemspec -g gherkin '>= 4.1.0'
@ -128,6 +134,9 @@ popd
%doc %{gem_instdir}/CHANGELOG.md %doc %{gem_instdir}/CHANGELOG.md
%changelog %changelog
* Fri Sep 07 2018 Vít Ondruch <vondruch@redhat.com> - 3.1.2-2
- Fix wire protocol.
* Thu Aug 23 2018 Jaroslav Prokop <jar.prokop@volny.cz> - 3.1.2-1 * Thu Aug 23 2018 Jaroslav Prokop <jar.prokop@volny.cz> - 3.1.2-1
- Update to Cucumber 3.1.2. - Update to Cucumber 3.1.2.

Loading…
Cancel
Save