spec/pupil_spec.rb in pupil-0.6.2 vs spec/pupil_spec.rb in pupil-0.6.3
- old
+ new
@@ -1,5 +1,7 @@
+# encoding: utf-8
+
# -*- coding: utf-8 -*-
### WARNING ###
# pupil_spec require PUPIL_TESTKEY in spec_testkey.rb
# You should create file spec_testkey.rb into /spec to define PUPIL_TESTKEY with Pupil key.
@@ -50,23 +52,23 @@
end
describe Pupil, "が #user_timeline を呼ぶ時は" do
before do
pupil = Pupil.new PUPIL_TESTKEY
- @user_timeline = pupil.user_timeline pupil.screen_name
+ @user_timeline = pupil.user_timeline pupil.profile.screen_name
end
it "Array型を返すこと" do
@user_timeline.class.should == Array
end
end
describe Pupil, "が #friendship? を呼ぶ時は" do
before do
pupil = Pupil.new PUPIL_TESTKEY
- @nonfriendship = pupil.friendship? pupil.screen_name, KNOWN_NONFOLLOWED_USER
- @friendship = pupil.friendship? pupil.screen_name, KNOWN_USER
+ @nonfriendship = pupil.friendship? pupil.profile.screen_name, KNOWN_NONFOLLOWED_USER
+ @friendship = pupil.friendship? pupil.profile.screen_name, KNOWN_USER
end
it "フォロー関係に無い場合はFalseClass型を返すこと" do
@nonfriendship.class.should == FalseClass
end
@@ -74,74 +76,10 @@
it "フォロー関係にある場合はTrueClass型を返すこと" do
@friendship.class.should == TrueClass
end
end
-describe Pupil, "が #follow を呼ぶ時は" do
- before do
- pupil = Pupil.new PUPIL_TESTKEY
- @follow = pupil.follow KNOWN_NONFOLLOWED_USER
- @follow_fail = pupil.follow UNKNOWN_USER
- end
-
- it "フォローに成功した場合はPupil::User型を返すこと" do
- @follow.class.should == Pupil::User
- end
-
- it "フォローに失敗した場合はFalseClass型を返すこと" do
- @follow_fail.class.should == FalseClass
- end
-end
-
-describe Pupil, "が #unfollow を呼ぶ時は" do
- before do
- pupil = Pupil.new PUPIL_TESTKEY
- @unfollow = pupil.unfollow KNOWN_NONFOLLOWED_USER
- @unfollow_fail = pupil.unfollow UNKNOWN_USER
- end
-
- it "成功した場合はPupil::User型を返すこと" do
- @unfollow.class.should == Pupil::User
- end
-
- it "失敗した場合にはFalseClassを返すこと" do
- @unfollow_fail.class.should == FalseClass
- end
-end
-
-describe Pupil, "が #block を呼ぶ時は" do
- before do
- pupil = Pupil.new PUPIL_TESTKEY
- @block = pupil.block KNOWN_NONFOLLOWED_USER
- @block_fail = pupil.block UNKNOWN_USER
- end
-
- it "成功した場合はPupil::User型を返すこと" do
- @block.class.should == Pupil::User
- end
-
- it "失敗した場合にはFalseClassを返すこと" do
- @block_fail.class.should == FalseClass
- end
-end
-
-describe Pupil, "が #unblock を呼ぶ時は" do
- before do
- pupil = Pupil.new PUPIL_TESTKEY
- @unblock = pupil.unblock KNOWN_NONFOLLOWED_USER
- @unblock_fail = pupil.unblock UNKNOWN_USER
- end
-
- it "成功した場合はPupil::User型を返すこと" do
- @unblock.class.should == Pupil::User
- end
-
- it "失敗した場合にはFalseClassを返すこと" do
- @unblock_fail.class.should == FalseClass
- end
-end
-
describe Pupil, "が #blocking を呼ぶ時は" do
before do
pupil = Pupil.new PUPIL_TESTKEY
@blocking = pupil.blocking
end
@@ -149,19 +87,19 @@
it "Array型を返すこと" do
@blocking.class.should == Array
end
end
-describe Pupil, "が、 #search を呼ぶ時は" do
+describe Pupil, "が #search を呼ぶ時は" do
before do
pupil = Pupil.new PUPIL_TESTKEY
- @search = pupil.search("Twitter", :rpp => 10)
+ @search = pupil.search("Twitter", :rpp => 1)
end
it "Array型を返すこと" do
@search.class.should == Array
end
- it "sizeが10であること" do
- @search.size.should == 10
+ it "sizeが1であること" do
+ @search.size.should == 1
end
end
\ No newline at end of file