I have a module like this (but more complicated):
module Aliasable def self.included(base) base.has_many :aliases, :as => :aliasable end end which I include in several models. Currently for testing I make another module as below, which I just include in the test case
module AliasableTest def self.included(base) base.class_exec do should have_many(:aliases) end end end The question is how do I go about testing this module in isolation? Or is the above way good enough. Seems like there is probably a better way to do it.