module FrameworkIdentificator
  module Framework
    module ClassMethods
      def son_name
        @son_name
      end
      def son_name=(name)
        @son_name = name
      end

      # Collect and return classes representing testing frameworks implemented into the FrameworkIdentificator::TestingFrameworks module
      def available
        son = eval("FrameworkIdentificator::#{son_name}")
        son.constants.select{|klass|
          son.const_get(klass).is_a?(Class)
        }.collect{|klass_sym|
          eval("FrameworkIdentificator::#{son_name}::#{klass_sym.to_s}")
        }
      end
    end
    extend ClassMethods

    def self.included(including)
      including.extend(ClassMethods)
      including.son_name = including.name.split("::").last
    end
  end
end