module ActiveSupport::Testing::Metadata::ClassMethods

Public Instance Methods

compute_metadata(metadata) click to toggle source
# File lib/active_support/testing/metadata.rb, line 18
def compute_metadata(metadata)
  meta = if metadata[-1].is_a?(Hash)
           metadata.pop
         else
           {}
         end
  metadata.each { |key| meta[key] = true }
  meta
end
metadata() click to toggle source
# File lib/active_support/testing/metadata.rb, line 28
def metadata
  @metadata ||= Hash.new({})
end
test(name, *metadata, &block) click to toggle source
Calls superclass method
# File lib/active_support/testing/metadata.rb, line 12
def test(name, *metadata, &block)
  super(name, &block)
  test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
  self.metadata[test_name.to_s] = compute_metadata(metadata)
end