Sha256: eb0db9cd348b9f679f663d65ad58d8a1fae9b36e1b2723528201ec3175f9c8a2

Contents?: true

Size: 587 Bytes

Versions: 7

Compression:

Stored size: 587 Bytes

Contents

module Woulda
  module ActsAsXapian
    module Macros
      
      #
      # should_act_as_xapian :name, :description
      #
      def should_act_as_xapian(*fields)
        klass = model_class

        context "A #{klass}" do
          should "include ActsAsXapian methods" do
            assert klass.include?(ActsAsXapian::InstanceMethods)
          end  

          fields.each do |field|
            should "index field #{field}" do
              assert klass.xapian_options[:texts].include?(field)
            end
          end
        end

      end
      
    end    
  end  
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
clearlynuts-woulda-0.2.3 lib/woulda/acts_as_xapian/macros.rb
clearlynuts-woulda-0.2.4 lib/woulda/acts_as_xapian/macros.rb
seanhussey-woulda-0.1.6 lib/woulda/acts_as_xapian/macros.rb
seanhussey-woulda-0.2.0 lib/woulda/acts_as_xapian/macros.rb
seanhussey-woulda-0.2.1 lib/woulda/acts_as_xapian/macros.rb
seanhussey-woulda-0.2.2 lib/woulda/acts_as_xapian/macros.rb
webmat-woulda-0.1.7 lib/woulda/acts_as_xapian/macros.rb