Skip to content
Browse files

remove auto include code from project

  • Loading branch information...
1 parent 5fc7fbe commit 7b4000bd5db6e4bc24db28323818a0652ca505f8 @schneems committed Nov 14, 2011
Showing with 4 additions and 33 deletions.
  1. +0 −12 lib/likeable/module_methods.rb
  2. +0 −20 spec/likeable/setup_spec.rb
  3. +4 −1 spec/spec_helper.rb
View
12 lib/likeable/module_methods.rb
@@ -117,20 +117,8 @@ def include_in_class(klass, include_item)
end
end
- def make_classes_likeable
- classes.each do |klass|
- include_in_class(klass, Likeable)
- end
- end
-
- def give_users_like_ability
- include_in_class user_class, ::Likeable::UserMethods if user_class
- end
-
def setup(&block)
yield self unless block.blank?
- make_classes_likeable
- give_users_like_ability
true
end
end
View
20 spec/likeable/setup_spec.rb
@@ -31,26 +31,6 @@ def id
@target = SetupCleanTestClassForLikeable.new
end
- it "adds Likeable::UserMethods to the class" do
- describe User.ancestors do
- it {should_not include Likeable::UserMethods}
- end
- Likeable.setup
- describe User.ancestors do
- it {should include Likeable::UserMethods}
- end
- end
-
- it "adds likeable to class" do
- Likeable.setup do |like|
- like.classes = LikeableIncludedInSetup
- end
-
- describe LikeableIncludedInSetup.ancestors do
- it {should include Likeable}
- end
- end
-
it "" do
result = "foo"
Likeable.setup
View
5 spec/spec_helper.rb
@@ -6,9 +6,13 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../..', 'lib'))
+require 'likeable'
+
+
def build_user!
eval %Q{
class User
+ include Likeable::UserMethods
def id
@time ||= Time.now.to_f.to_s
end
@@ -37,7 +41,6 @@ def reload_user!
build_user!
-require 'likeable'
require 'rspec'
require 'rspec/autorun'

0 comments on commit 7b4000b

Please sign in to comment.
Something went wrong with that request. Please try again.