Module: RspecBddStyle

Defined in:
lib/rspec_bdd_style.rb

Constant Summary collapse

PREFIXES =
%w[given when and then].freeze

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object (private)



24
25
26
27
28
29
30
# File 'lib/rspec_bdd_style.rb', line 24

def method_missing(method_name, *args, &block)
  PREFIXES.each do |prefix|
    return send("#{prefix}_method_missing", method_name, *args, &block) if method_name.to_s.start_with?("#{prefix}_")
  end

  super(method_name, *args, &block)
end