Sha256: da448645105ac36161bf5814c4a4c9bc4d7820c4f43a20ba81543842e8c48da6
Contents?: true
Size: 477 Bytes
Versions: 6
Compression:
Stored size: 477 Bytes
Contents
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
Version data entries
6 entries across 6 versions & 3 rubygems