Sha256: 3e0f051db764f5c7c342ba2ba4035354eefbfb8891c438591b5de10311b64c33

Contents?: true

Size: 460 Bytes

Versions: 27

Compression:

Stored size: 460 Bytes

Contents

module Turnip
  module Define
    def step(method_name=nil, expression, &block)
      if method_name and block
        raise ArgumentError, "can't specify both method name and a block for a step"
      end
      step = Turnip::StepDefinition.new(expression, method_name, caller.first, &block)
      send(:define_method, "match: #{expression}") { |description| step.match(description) }
      send(:define_method, expression, &block) if block
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
turnip-4.4.1 lib/turnip/define.rb
turnip-4.4.0 lib/turnip/define.rb
turnip-4.3.0 lib/turnip/define.rb
turnip-4.2.0 lib/turnip/define.rb
turnip-4.1.0 lib/turnip/define.rb
turnip-4.0.1 lib/turnip/define.rb
turnip-4.0.0 lib/turnip/define.rb
turnip-3.1.0 lib/turnip/define.rb
turnip-3.0.0 lib/turnip/define.rb
turnip-3.0.0.pre.beta.5 lib/turnip/define.rb
turnip-3.0.0.pre.beta.4 lib/turnip/define.rb
turnip-3.0.0.pre.beta.3 lib/turnip/define.rb
turnip-3.0.0.pre.beta.2 lib/turnip/define.rb
turnip-3.0.0.pre.beta.1 lib/turnip/define.rb
turnip-2.1.1 lib/turnip/define.rb
turnip-2.1.0 lib/turnip/define.rb
turnip-2.0.2 lib/turnip/define.rb
turnip-2.0.1 lib/turnip/define.rb
turnip-2.0.0 lib/turnip/define.rb
turnip-1.3.1 lib/turnip/define.rb