Permalink
Browse files

Added method aliases

  • Loading branch information...
1 parent 76a8d7e commit 512c4bef5eafeb0effbfbff35a77a9381fb26530 @cmer committed Jun 13, 2012
@@ -3,6 +3,7 @@ class Base
def is_follower?
false
end
+ alias follower? is_follower?
end
end
@@ -17,6 +18,7 @@ module Follower
def is_follower?
true
end
+ alias follower? is_follower?
# Create a new {Follow follow} relationship.
#
@@ -3,6 +3,7 @@ class Base
def is_liker?
false
end
+ alias liker? is_liker?
end
end
@@ -17,6 +18,7 @@ module Liker
def is_liker?
true
end
+ alias liker? is_liker?
# Create a new {Like like} relationship.
#
@@ -3,6 +3,7 @@ class Base
def is_mentioner?
false
end
+ alias mentioner? is_mentioner?
end
end
@@ -17,6 +18,7 @@ module Mentioner
def is_mentioner?
true
end
+ alias mentioner? is_mentioner?
# Create a new {Mention mention} relationship.
#
@@ -3,6 +3,7 @@ class Base
def is_followable?
false
end
+ alias followable? is_followable?
end
end
@@ -17,6 +18,7 @@ module Followable
def is_followable?
true
end
+ alias followable? is_followable?
# Specifies if self is followed by a {Follower} object.
#
@@ -3,6 +3,7 @@ class Base
def is_likeable?
false
end
+ alias likeable? is_likeable?
end
end
@@ -17,6 +18,7 @@ module Likeable
def is_likeable?
true
end
+ alias likeable? is_likeable?
# Specifies if self is liked by a {Liker} object.
#
@@ -3,6 +3,7 @@ class Base
def is_mentionable?
false
end
+ alias mentionable? is_mentionable?
end
end
@@ -17,6 +18,7 @@ module Mentionable
def is_mentionable?
true
end
+ alias mentionable? is_mentionable?
# Specifies if self is mentioned by a {Mentioner} object.
#
@@ -7,12 +7,18 @@ class FollowerTest < Test::Unit::TestCase
@followable = ImAFollowable.create
end
- context "#is_follower" do
+ context "#is_follower?" do
should "return true" do
assert_true @follower.is_follower?
end
end
+ context "#follower?" do
+ should "return true" do
+ assert_true @follower.follower?
+ end
+ end
+
context "#follow!" do
should "not accept non-followables" do
assert_raise(ArgumentError) { @follower.follow!(:foo) }
@@ -7,12 +7,18 @@ class LikerTest < Test::Unit::TestCase
@likeable = ImALikeable.create
end
- context "#is_liker" do
+ context "#is_liker?" do
should "return true" do
assert_true @liker.is_liker?
end
end
+ context "#liker?" do
+ should "return true" do
+ assert_true @liker.liker?
+ end
+ end
+
context "#like!" do
should "not accept non-likeables" do
assert_raise(ArgumentError) { @liker.like!(:foo) }
@@ -7,12 +7,18 @@ class MentionerTest < Test::Unit::TestCase
@mentionable = ImAMentionable.create
end
- context "#is_mentioner" do
+ context "#is_mentioner?" do
should "return true" do
assert_true @mentioner.is_mentioner?
end
end
+ context "#mentioner?" do
+ should "return true" do
+ assert_true @mentioner.mentioner?
+ end
+ end
+
context "#mention!" do
should "not accept non-mentionables" do
assert_raise(ArgumentError) { @mentioner.mention!(:foo) }
@@ -7,12 +7,18 @@ class FollowableTest < Test::Unit::TestCase
@followable = ImAFollowable.create
end
- context "#is_followable" do
+ context "#is_followable?" do
should "return true" do
assert_true @followable.is_followable?
end
end
+ context "#followable?" do
+ should "return true" do
+ assert_true @followable.followable?
+ end
+ end
+
context "#followed_by?" do
should "not accept non-followers" do
assert_raise(ArgumentError) { @followable.followed_by?(:foo) }
@@ -7,12 +7,18 @@ class LikeableTest < Test::Unit::TestCase
@likeable = ImALikeable.create
end
- context "#is_likeable" do
+ context "#is_likeable?" do
should "return true" do
assert_true @likeable.is_likeable?
end
end
+ context "#likeable?" do
+ should "return true" do
+ assert_true @likeable.likeable?
+ end
+ end
+
context "#liked_by?" do
should "not accept non-likers" do
assert_raise(ArgumentError) { @likeable.liked_by?(:foo) }
@@ -7,12 +7,18 @@ class MentionableTest < Test::Unit::TestCase
@mentionable = ImAMentionable.create
end
- context "#is_mentionable" do
+ context "#is_mentionable?" do
should "return true" do
assert_true @mentionable.is_mentionable?
end
end
+ context "#mentionable?" do
+ should "return true" do
+ assert_true @mentionable.mentionable?
+ end
+ end
+
context "#mentioned_by?" do
should "not accept non-mentioners" do
assert_raise(ArgumentError) { @mentionable.mentioned_by?(:foo) }

0 comments on commit 512c4be

Please sign in to comment.