You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
477 B
18 lines
477 B
module ThoughtBot # :nodoc:
|
|
module Shoulda # :nodoc:
|
|
module Private # :nodoc:
|
|
def get_options!(args, *wanted)
|
|
ret = []
|
|
opts = (args.last.is_a?(Hash) ? args.pop : {})
|
|
wanted.each {|w| ret << opts.delete(w)}
|
|
raise ArgumentError, "Unsuported options given: #{opts.keys.join(', ')}" unless opts.keys.empty?
|
|
return *ret
|
|
end
|
|
|
|
def model_class
|
|
self.name.gsub(/Test$/, '').constantize
|
|
end
|
|
end
|
|
end
|
|
end
|