has_friends_ti2 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/has_friends_ti2/has_friends.rb +3 -1
- data/lib/has_friends_ti2/version.rb +1 -1
- data/spec/has_friends_spec.rb +9 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d04d76235ce9ac8de066d1a1cf66dab32d4e5385
|
|
4
|
+
data.tar.gz: dc7b830d081a04cb5a6a0d0a06c7c99cce4ea569
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: abb8948ac2b38de9bc8cef60ff78ed7363b15e2027f214f7854a78e025b898c5e69c6f6315120da3a0a877ba7b6af63913a4173a5e09b0a6e0919b0c0ff70a06
|
|
7
|
+
data.tar.gz: 83446e42a2a576438c76b37c3035b881fb5c5ece62a4688ee367d7d2cc1496d5f8961bb1e9024b73ca5a903adbd7a42962e3b084714f63cb803d9c8200568e4f
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require 'pry'
|
|
1
2
|
module HasFriends
|
|
2
3
|
|
|
3
4
|
module Friends
|
|
@@ -56,7 +57,8 @@ module HasFriends
|
|
|
56
57
|
friendship = friendship_for(friend)
|
|
57
58
|
friendship && friendship.accepted?
|
|
58
59
|
end
|
|
59
|
-
def are_friends
|
|
60
|
+
def are_friends(friend)
|
|
61
|
+
pry
|
|
60
62
|
friendship = friendship_for(friend)
|
|
61
63
|
friendship && friendship.accepted?
|
|
62
64
|
end
|
data/spec/has_friends_spec.rb
CHANGED
|
@@ -17,6 +17,7 @@ describe 'has_friends' do
|
|
|
17
17
|
@leia = User.create(:login => "princess_leia")
|
|
18
18
|
@han_solo = User.create(:login => "han_solo")
|
|
19
19
|
@yoda = User.create(:login => "yoda")
|
|
20
|
+
@alone= User.create(:login=>"alone")
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
describe 'methods' do
|
|
@@ -32,8 +33,8 @@ describe 'has_friends' do
|
|
|
32
33
|
expect( @vader ).to respond_to :friends?
|
|
33
34
|
end
|
|
34
35
|
|
|
35
|
-
it "should respond to
|
|
36
|
-
expect( @vader ).to respond_to :are_friends
|
|
36
|
+
it "should respond to are_friends method" do
|
|
37
|
+
expect( @vader ).to respond_to :are_friends
|
|
37
38
|
end
|
|
38
39
|
end
|
|
39
40
|
|
|
@@ -86,7 +87,12 @@ describe 'has_friends' do
|
|
|
86
87
|
|
|
87
88
|
it "should not be @vader" do
|
|
88
89
|
expect( @vader.is?(@leia) ).to_not be_truthy
|
|
89
|
-
end
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
it "should respond to are_friends method" do
|
|
93
|
+
expect( @alone.are_friends( @vader) ).to be nil
|
|
94
|
+
expect( @yoda.are_friends( @luke) ).to be_truthy
|
|
95
|
+
end
|
|
90
96
|
end
|
|
91
97
|
|
|
92
98
|
describe "friendship request" do
|