You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.2 KiB
71 lines
2.2 KiB
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
|