Module: Turnip::DSL

Defined in:
lib/turnip/dsl.rb

Instance Method Summary collapse

Instance Method Details

#placeholder(name, &block) ⇒ Object


3
4
5
# File 'lib/turnip/dsl.rb', line 3

def placeholder(name, &block)
  Turnip::Placeholder.add(name, &block)
end

#step(description, &block) ⇒ Object


7
8
9
# File 'lib/turnip/dsl.rb', line 7

def step(description, &block)
  Turnip::Steps.step(description, &block)
end

#steps_for(tag, &block) ⇒ Object


11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/turnip/dsl.rb', line 11

def steps_for(tag, &block)
  if tag.to_s == "global"
    warn "[Turnip] using steps_for(:global) is deprecated, add steps to Turnip::Steps instead"
    Turnip::Steps.module_eval(&block)
  else
    Module.new do
      singleton_class.send(:define_method, :tag) { tag }
      module_eval(&block)
      ::RSpec.configure { |c| c.include self, tag => true }
    end
  end
end