#2 Update to cucumber-wire 6.2.0
Closed 2 years ago by jackorp. Opened 2 years ago by jackorp.
rpms/ jackorp/rubygem-cucumber-wire rawhide  into  rawhide

file modified
+2 -1
@@ -1,1 +1,2 @@ 

- /cucumber-wire-0.0.1.gem

+ /cucumber-wire-*.gem

+ /rubygem-cucumber-wire-*-features.txz

@@ -1,206 +0,0 @@ 

- From 51ff0156094757ad21b8f380e2427d5b366924fa Mon Sep 17 00:00:00 2001

- From: =?UTF-8?q?Bj=C3=B6rn=20Rasmusson?= <B.Rasmusson@computer.org>

- Date: Sun, 22 Jul 2018 21:23:34 +0200

- Subject: [PATCH] Fixes to work with modern Cucucmber-Ruby

- 

- * Pass the registry all the way down to the step definitions.

- * Move the class StepArgument from Cucumber-Ruby and update it to match

-   the expectations of Cucumber-Ruby when using cucumber-expressions.

- ---

-  features/step_matches_message.feature  |  2 +-

-  lib/cucumber/wire/connections.rb       |  5 +++--

-  lib/cucumber/wire/plugin.rb            |  9 +++++----

-  lib/cucumber/wire/protocol.rb          |  4 ++--

-  lib/cucumber/wire/protocol/requests.rb |  4 ++--

-  lib/cucumber/wire/request_handler.rb   |  3 ++-

-  lib/cucumber/wire/step_argument.rb     | 24 ++++++++++++++++++++++++

-  lib/cucumber/wire/step_definition.rb   |  6 ++++--

-  spec/cucumber/wire/connections_spec.rb |  4 ++--

-  9 files changed, 45 insertions(+), 16 deletions(-)

-  create mode 100644 lib/cucumber/wire/step_argument.rb

- 

- diff --git a/features/step_matches_message.feature b/features/step_matches_message.feature

- index b0051f8..afa70be 100644

- --- a/features/step_matches_message.feature

- +++ b/features/step_matches_message.feature

- @@ -70,7 +70,7 @@ Feature: Step matches message

-        """

-        -

-  

- -      we.*   # MyApp.MyClass:123

- +      "we.*"   # MyApp.MyClass:123

-  

-        1 scenario (1 skipped)

-        1 step (1 skipped)

- diff --git a/lib/cucumber/wire/connections.rb b/lib/cucumber/wire/connections.rb

- index 7856fea..4e57a22 100644

- --- a/lib/cucumber/wire/connections.rb

- +++ b/lib/cucumber/wire/connections.rb

- @@ -16,10 +16,11 @@ class Connections

-        attr_reader :connections

-        private :connections

-  

- -      def initialize(connections, configuration)

- +      def initialize(connections, configuration, registry)

-          raise ArgumentError unless connections

-          @connections = connections

-          @configuration = configuration

- +        @registry = registry

-        end

-  

-        def find_match(test_step)

- @@ -30,7 +31,7 @@ def find_match(test_step)

-        end

-  

-        def step_matches(step_name)

- -        connections.map{ |c| c.step_matches(step_name)}.flatten

- +        connections.map{ |c| c.step_matches(step_name, @registry)}.flatten

-        end

-  

-        def begin_scenario(test_case)

- diff --git a/lib/cucumber/wire/plugin.rb b/lib/cucumber/wire/plugin.rb

- index d1d6277..79843cd 100644

- --- a/lib/cucumber/wire/plugin.rb

- +++ b/lib/cucumber/wire/plugin.rb

- @@ -5,15 +5,16 @@

-  module Cucumber

-    module Wire

-      class Plugin

- -      attr_reader :config

- -      private :config

- +      attr_reader :config, :registry

- +      private :config, :registry

-  

- -      def initialize(config)

- +      def initialize(config, registry)

-          @config = config

- +        @registry = registry

-        end

-  

-        def install

- -        connections = Connections.new(wire_files.map { |f| create_connection(f) }, @config)

- +        connections = Connections.new(wire_files.map { |f| create_connection(f) }, config, registry)

-          config.filters << Filters::ActivateSteps.new(StepMatchSearch.new(connections.method(:step_matches), @config), @config)

-          config.filters << AddHooksFilter.new(connections) unless @config.dry_run?

-          config.register_snippet_generator Snippet::Generator.new(connections)

- diff --git a/lib/cucumber/wire/protocol.rb b/lib/cucumber/wire/protocol.rb

- index 328c728..738577e 100644

- --- a/lib/cucumber/wire/protocol.rb

- +++ b/lib/cucumber/wire/protocol.rb

- @@ -3,8 +3,8 @@

-  module Cucumber

-    module Wire

-      module Protocol

- -      def step_matches(name_to_match)

- -        handler = Requests::StepMatches.new(self)

- +      def step_matches(name_to_match, registry)

- +        handler = Requests::StepMatches.new(self, registry)

-          handler.execute(name_to_match)

-        end

-  

- diff --git a/lib/cucumber/wire/protocol/requests.rb b/lib/cucumber/wire/protocol/requests.rb

- index eff80b0..5e32d11 100644

- --- a/lib/cucumber/wire/protocol/requests.rb

- +++ b/lib/cucumber/wire/protocol/requests.rb

- @@ -1,5 +1,5 @@

-  require 'cucumber/wire/request_handler'

- -require 'cucumber/step_argument'

- +require 'cucumber/wire/step_argument'

-  

-  module Cucumber

-    module Wire

- @@ -25,7 +25,7 @@ def handle_success(params)

-            private

-  

-            def create_step_match(raw_step_match)

- -            step_definition = StepDefinition.new(@connection, raw_step_match)

- +            step_definition = StepDefinition.new(@connection, raw_step_match, @registry)

-              step_args = raw_step_match['args'].map do |raw_arg|

-                StepArgument.new(raw_arg['pos'], raw_arg['val'])

-              end

- diff --git a/lib/cucumber/wire/request_handler.rb b/lib/cucumber/wire/request_handler.rb

- index ee8f2f1..118f9cd 100644

- --- a/lib/cucumber/wire/request_handler.rb

- +++ b/lib/cucumber/wire/request_handler.rb

- @@ -1,9 +1,10 @@

-  module Cucumber

-    module Wire

-      class RequestHandler

- -      def initialize(connection)

- +      def initialize(connection, registry = nil)

-          @connection = connection

-          @message = underscore(self.class.name.split('::').last)

- +        @registry = registry

-        end

-  

-        def execute(request_params = nil)

- diff --git a/lib/cucumber/wire/step_argument.rb b/lib/cucumber/wire/step_argument.rb

- new file mode 100644

- index 0000000..116ee3a

- --- /dev/null

- +++ b/lib/cucumber/wire/step_argument.rb

- @@ -0,0 +1,24 @@

- +# frozen_string_literal: true

- +require 'cucumber/cucumber_expressions/group'

- +

- +module Cucumber

- +  module Wire

- +    # Defines the location and value of a captured argument from the step

- +    # text

- +    class StepArgument

- +      attr_reader :offset

- +

- +      def initialize(offset, val)

- +        @offset, @value = offset, val

- +      end

- +

- +      def value(_current_world)

- +        @value

- +      end

- +

- +      def group

- +        CucumberExpressions::Group.new(@value, @offset, @offset + @value.length, [])

- +      end

- +    end

- +  end

- +end

- diff --git a/lib/cucumber/wire/step_definition.rb b/lib/cucumber/wire/step_definition.rb

- index 09a4f1d..b453cdc 100644

- --- a/lib/cucumber/wire/step_definition.rb

- +++ b/lib/cucumber/wire/step_definition.rb

- @@ -3,12 +3,14 @@

-  module Cucumber

-    module Wire

-      class StepDefinition

- -      attr_reader :regexp_source, :location

- +      attr_reader :regexp_source, :location, :registry, :expression

-  

- -      def initialize(connection, data)

- +      def initialize(connection, data, registry)

-          @connection = connection

- +        @registry   = registry

-          @id              = data['id']

-          @regexp_source   = data['regexp'] || "Unknown"

- +        @expression      = registry.create_expression(@regexp_source)

-          @location        = Core::Ast::Location.from_file_colon_line(data['source'] || "unknown:0")

-        end

-  

- diff --git a/spec/cucumber/wire/connections_spec.rb b/spec/cucumber/wire/connections_spec.rb

- index 449e19f..62c9f1a 100644

- --- a/spec/cucumber/wire/connections_spec.rb

- +++ b/spec/cucumber/wire/connections_spec.rb

- @@ -9,12 +9,12 @@ module Wire

-            connection1 = double(step_matches: [:a, :b])

-            connection2 = double(step_matches: [:c])

-  

- -          connections = Connections.new([connection1, connection2], double)

- +          connections = Connections.new([connection1, connection2], double, double)

-            expect(connections.step_matches('')).to eq [:a, :b, :c]

-          end

-  

-          it "copes with no connections" do

- -          connections = Connections.new([], double)

- +          connections = Connections.new([], double, double)

-            expect(connections.step_matches('')).to eq []

-          end

-        end

file modified
+32 -21
@@ -1,22 +1,22 @@ 

  # Generated from cucumber-wire-0.0.1.gem by gem2rpm -*- rpm-spec -*-

  %global gem_name cucumber-wire

  

- %{?_with_bootstrap: %global bootstrap 1}

+ %bcond_without bootstrap

  

  Name: rubygem-%{gem_name}

- Version: 0.0.1

- Release: 15%{?dist}

+ Version: 6.2.0

+ Release: 1%{?dist}

  Summary: Wire protocol for Cucumber

  License: MIT

  URL: http://cucumber.io

  Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem

- # Fix compatibility with Cucumber 3.1+

- # https://github.com/cucumber/cucumber-ruby-wire/pull/14

- Patch0: rubygem-cucumber-wire-0.0.1-Adapt-to-the-move-of-Location-to-Cucumber-Core-Test.patch

+ # git clone --no-checkout https://github.com/cucumber/cucumber-ruby-wire.git

+ # git -C cucumber-ruby-wire archive -v -o rubygem-cucumber-wire-6.2.0-features.txz v6.2.0 features/

+ Source1: %{name}-%{version}-features.txz

  BuildRequires: ruby(release)

  BuildRequires: rubygems-devel

  BuildRequires: ruby

- %if ! 0%{?bootstrap}

+ %if %{without bootstrap}

  # Dependencies for %%check

  BuildRequires: rubygem(aruba)

  BuildRequires: rubygem(cucumber)
@@ -37,17 +37,17 @@ 

  Documentation for %{name}.

  

  %prep

- %setup -q -n %{gem_name}-%{version}

+ %setup -q -n %{gem_name}-%{version} -b1

  

- %patch0 -p1

- %gemspec_add_file 'lib/cucumber/wire/step_argument.rb'

+ # Relax the dependency.

+ %gemspec_remove_dep -g cucumber-cucumber-expressions "~> 14.0", ">= 14.0.0"

+ %gemspec_add_dep -g cucumber-cucumber-expressions ">= 14.0"

+ 

+ %gemspec_remove_dep -g  cucumber-messages "~> 17.1", ">= 17.1.1"

+ %gemspec_add_dep -g cucumber-messages ">= 17.0"

  

  %build

- # Create the gem as gem install only works on a gem file

  gem build ../%{gem_name}-%{version}.gemspec

- 

- # %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir

- # by default, so that we can move it into the buildroot in %%install

  %gem_install

  

  %install
@@ -56,14 +56,18 @@ 

          %{buildroot}%{gem_dir}/

  

  

- %if ! 0%{?bootstrap}

+ %if %{without bootstrap}

  %check

  pushd .%{gem_instdir}

- LANG=C.UTF-8 rspec spec

+ 

+ rspec -Ilib spec

+ 

+ ln -s %{_builddir}/features features

  

  # Ensure the current version of cucumber-wire is used in place of system one,

  # pulled in as a Cucumber dependency.

- RUBYOPT="-I$(pwd)/lib" cucumber

+ RUBYOPT="-I$(pwd)/lib" cucumber --format progress --publish-quiet

+ 

  popd

  %endif

  
@@ -73,17 +77,24 @@ 

  %{gem_libdir}

  %exclude %{gem_cache}

  %{gem_spec}

+ %license %{gem_instdir}/LICENSE

  

  %files doc

  %doc %{gem_docdir}

- %{gem_instdir}/Gemfile

  %doc %{gem_instdir}/README.md

- %{gem_instdir}/Rakefile

- %{gem_instdir}/cucumber-wire.gemspec

- %{gem_instdir}/features

+ %doc %{gem_instdir}/CHANGELOG.md

+ %doc %{gem_instdir}/CONTRIBUTING.md

  %{gem_instdir}/spec

  

  %changelog

+ * Thu Sep 30 2021 Jarek Prokop <jprokop@redhat.com> - 6.2.0-1

+ - Relax rubygem-cucumber-cucumber-expressions dependency.

+ - Update to cucumber-wire 6.2.0.

+ 

+ * Mon Sep 06 2021 Pavel Valena <pvalena@redhat.com> - 6.1.1-1

+ - Update to cucumber-wire 6.1.1.

+   Resolves: rhbz#1867935

+ 

  * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.1-15

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

file modified
+2 -1
@@ -1,1 +1,2 @@ 

- 875d967d513d5906214744a82409621c  cucumber-wire-0.0.1.gem

+ SHA512 (cucumber-wire-6.2.0.gem) = ae2dd0652705a900de0d873c492b255bae7dd89a3c8da610890e73f69e714d3112f023bb988a1621cc7c0c1b2d2607385bc7673ec57678c032c32bcef604f8b5

+ SHA512 (rubygem-cucumber-wire-6.2.0-features.txz) = 31175d9d3d7e481c879230cf4a6092f40a5ed1ce8f277d817ff77441e818b2cade387fc8c16788b8d6eb1d9a796d5534fe80ffc83a3fe62280db60bd11451a97

Copr build with tests enabled: ok
https://copr.fedorainfracloud.org/coprs/pvalena/rubygems/build/2868690/
Installation: ok
rpmlint: ok

Supersedes PR #1

WIP status set to not have it merged before dependencies are merged.

Maybe it would be better to add our current version here? Like ">= x.Y"?

I'm not sure what this is supposed to mean.

WIP status set to not have it merged before dependencies are merged.

Best to do it in side-tag then.

I'm not sure what this is supposed to mean.

Hmm. For some reason, I thought a test suite was removed from the project. Looks like it's just been removed from the gem, while it is still in project.

1 new commit added

  • Update to cucumber-wire 6.2.0.
2 years ago

2 new commits added

  • Update to cucumber-wire 6.2.0.
  • Update to cucumber-wire 6.1.1.
2 years ago

2 new commits added

  • Update to cucumber-wire 6.2.0.
  • Update to cucumber-wire 6.1.1.
2 years ago

Closing, change was merged locally and pushed.

(The web UI was failing for me for some reason.)

Pull-Request has been closed by jackorp

2 years ago