Method: RSpecStepwise::ClassMethods#before

Defined in:
lib/two-step/stepwise.rb

#before(*args, &block) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
# File 'lib/two-step/stepwise.rb', line 96

def before(*args, &block)
  if args.first == :step
    args.shift
    options = (args)
    return ((hooks[:before][:step] ||= []) << build_before_hook(options, &block))
  end
  if args.first == :each
    puts "before blocks declared for steps are always treated as :all scope"
  end
  super
end