module ThoughtBot::Shoulda::Private
def get_options!(args, *wanted)
Returns the values for the entries in the args hash who's keys are listed in the wanted array.
:nodoc:
:nodoc:
:nodoc:
def get_options!(args, *wanted) ret = [] opts = (args.last.is_a?(Hash) ? args.pop : {}) wanted.each {|w| ret << opts.delete(w)} raise ArgumentError, "Unsupported options given: #{opts.keys.join(', ')}" unless opts.keys.empty? return *ret end
def model_class
Returns the model class constant, as determined by the test class name.
def model_class self.name.gsub(/Test$/, '').constantize end