Sha256: 8acc3dd9b4f8e2e874238128f466e58eb000cb463a91625610d69835b85267b2

Contents?: true

Size: 1006 Bytes

Versions: 13

Compression:

Stored size: 1006 Bytes

Contents

module Woulda
  module EnumerationsMixin
    module Macros
      def should_act_as_enumerated(options = {})
        klass = model_class

        should_have_db_columns :name

        should "define Enumerated macro methods" do
          class_modules = (class << klass; included_modules; end)
          assert class_modules.include?(ActiveRecord::Acts::Enumerated::MacroMethods), "#{klass} doesn't define Enumerated macro methods"
        end

        should "define Enumerated class methods" do
          class_modules = (class << klass; included_modules; end)
          assert class_modules.include?(ActiveRecord::Acts::Enumerated::ClassMethods), "#{klass} doesn't define Enumerated class methods"
        end

        should "define Enumerated instance methods" do
          instance_modules = klass.included_modules
          assert instance_modules.include?(ActiveRecord::Acts::Enumerated::InstanceMethods), "#{klass} doesn't define Enumerated instance methods"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
clearlynuts-woulda-0.2.3 lib/woulda/enumerations_mixin/macros.rb
clearlynuts-woulda-0.2.4 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.0.2 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.1.1 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.1.2 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.1.3 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.1.4 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.1.5 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.1.6 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.2.0 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.2.1 lib/woulda/enumerations_mixin/macros.rb
seanhussey-woulda-0.2.2 lib/woulda/enumerations_mixin/macros.rb
webmat-woulda-0.1.7 lib/woulda/enumerations_mixin/macros.rb