seanhussey-woulda 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.textile CHANGED
@@ -63,6 +63,11 @@ class ProductTest < Test::Unit::TestCase
63
63
  should_act_as_solr :name, :price
64
64
  end
65
65
 
66
+ # acts_as_xapian
67
+ class ProductTest < Test::Unit::TestCase
68
+ should_act_as_xapian :name, :description
69
+ end
70
+
66
71
  # acts_as_state_machine
67
72
  class OrderTest < Test::Unit::TestCase
68
73
  should_act_as_state_machine :initial => :open, :states => [:closed], :events => {:close_order => {:to => :closed, :from :open}}
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'rake/gempackagetask'
5
5
 
6
6
  spec = Gem::Specification.new do |s|
7
7
  s.name = "woulda"
8
- s.version = "0.1.5"
8
+ s.version = "0.1.6"
9
9
  s.summary = "woulda is a home for shoulda macros that don't belong in the main shoulda library"
10
10
  s.homepage = "http://github.com/seanhussey/woulda"
11
11
  s.rubyforge_project = "woulda"
data/lib/woulda.rb CHANGED
@@ -10,3 +10,4 @@ require "#{woulda_dir}/paperclip" if defined? Paperclip
10
10
  require "#{woulda_dir}/will_paginate" if defined? WillPaginate
11
11
  require "#{woulda_dir}/acts_as_solr" if defined? ActsAsSolr
12
12
  require "#{woulda_dir}/acts_as_state_machine" if defined? ScottBarron::Acts::StateMachine
13
+ require "#{woulda_dir}/acts_as_xapian" if defined? ActsAsXapian
@@ -1,5 +1,5 @@
1
1
  require 'shoulda'
2
- require File.dirname(__FILE__) + '/acts_as_taggable_on_steroids'
2
+ require File.dirname(__FILE__) + '/acts_as_taggable_on_steroids/macros'
3
3
 
4
4
  Test::Unit::TestCase.class_eval do
5
5
  extend Woulda::ActsAsTaggableOnSteroids::Macros
@@ -0,0 +1,6 @@
1
+ require 'shoulda'
2
+ require File.dirname(__FILE__) + '/acts_as_xapian/macros'
3
+
4
+ Test::Unit::TestCase.class_eval do
5
+ extend Woulda::ActsAsXapian::Macros
6
+ end
@@ -0,0 +1,27 @@
1
+ module Woulda
2
+ module ActsAsXapian
3
+ module Macros
4
+
5
+ #
6
+ # should_act_as_xapian :name, :description
7
+ #
8
+ def should_act_as_xapian(*fields)
9
+ klass = model_class
10
+
11
+ context "A #{klass}" do
12
+ should "include ActsAsXapian methods" do
13
+ assert klass.include?(ActsAsXapian::InstanceMethods)
14
+ end
15
+
16
+ fields.each do |field|
17
+ should "index field #{field}" do
18
+ assert klass.xapian_options[:texts].include?(field)
19
+ end
20
+ end
21
+ end
22
+
23
+ end
24
+
25
+ end
26
+ end
27
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seanhussey-woulda
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Hussey
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2008-11-01 00:00:00 -07:00
13
+ date: 2009-01-02 00:00:00 -08:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -56,6 +56,9 @@ files:
56
56
  - lib/woulda/acts_as_taggable_on_steroids
57
57
  - lib/woulda/acts_as_taggable_on_steroids/macros.rb
58
58
  - lib/woulda/acts_as_taggable_on_steroids.rb
59
+ - lib/woulda/acts_as_xapian
60
+ - lib/woulda/acts_as_xapian/macros.rb
61
+ - lib/woulda/acts_as_xapian.rb
59
62
  - lib/woulda/attachment_fu
60
63
  - lib/woulda/attachment_fu/macros.rb
61
64
  - lib/woulda/attachment_fu.rb