Sha256: e84940602d6c043f80a57992e189944ea67b32bc8ee9ce2ec8fce16c7904a425

Contents?: true

Size: 868 Bytes

Versions: 27

Compression:

Stored size: 868 Bytes

Contents

require 'gherkin/rubify'

module Cucumber
  module Ast
    module MultilineArgument

      class << self
        include Gherkin::Rubify

        def from(argument)
          return unless argument
          return argument if argument.respond_to?(:to_step_definition_arg)

          case(rubify(argument))
          when String
            # TODO: this duplicates work that gherkin does. We should really pass the string to gherkin and let it parse it.
            Ast::DocString.new(argument, '')
          when Gherkin::Formatter::Model::DocString
            Ast::DocString.new(argument.value, argument.content_type)
          when Array
            Ast::Table.new(argument.map{|row| row.cells})
          else
            raise ArgumentError, "Don't know how to convert #{argument} into a MultilineArgument"
          end
        end

      end
    end
  end
end

Version data entries

27 entries across 25 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/ast/multiline_argument.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/ast/multiline_argument.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.20 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.19 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.18 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.17 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.16 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.15 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.14 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.13 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.12 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.11 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.10 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.9 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.8 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.7 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.6 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.5 lib/cucumber/ast/multiline_argument.rb
cucumber-1.3.4 lib/cucumber/ast/multiline_argument.rb