File: step_argument.rb

package info (click to toggle)
ruby-cucumber-wire 8.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 140 kB
  • sloc: ruby: 499; makefile: 4
file content (26 lines) | stat: -rw-r--r-- 521 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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 = offset
        @value = val
      end

      def value(_current_world)
        @value
      end

      def group
        CucumberExpressions::Group.new(@value, @offset, @offset + @value.length, [])
      end
    end
  end
end