spec/pupil_spec.rb in pupil-0.1.3 vs spec/pupil_spec.rb in pupil-0.1.4
- old
+ new
@@ -4,10 +4,21 @@
# 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.
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
+describe Pupil, "が #verify_credentials を呼ぶ時は" do
+ before do
+ pupil = Pupil.new PUPIL_TESTKEY
+ @vc = pupil.verify_credentials
+ end
+
+ it "Pupil::User型を返すこと" do
+ @vc.class.should == Pupil::User
+ end
+end
+
describe Pupil, "が #home_timeline を呼ぶ時は" do
before do
pupil = Pupil.new PUPIL_TESTKEY
@home_timeline = pupil.home_timeline :count => 50
end
@@ -34,21 +45,10 @@
it "sizeが50であること" do
@mentions.size.should == 10
end
end
-describe Pupil, "が #verify_credentials を呼ぶ時は" do
- before do
- pupil = Pupil.new PUPIL_TESTKEY
- @vc = pupil.verify_credentials
- end
-
- it "Pupil::User型を返すこと" do
- @vc.class.should == Pupil::User
- end
-end
-
describe Pupil, "が #user_timeline を呼ぶ時は" do
before do
pupil = Pupil.new PUPIL_TESTKEY
@user_timeline = pupil.user_timeline :screen_name => pupil.screen_name
end
@@ -144,7 +144,22 @@
@blocking = pupil.blocking
end
it "Array型を返すこと" do
@blocking.class.should == Array
+ end
+end
+
+describe Pupil, "が、 #search を呼ぶ時は" do
+ before do
+ pupil = Pupil.new PUPIL_TESTKEY
+ @search = pupil.search("Twitter", :rpp => 10)
+ end
+
+ it "Array型を返すこと" do
+ @search.class.should == Array
+ end
+
+ it "sizeが10であること" do
+ @search.size.should == 10
end
end
\ No newline at end of file