Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
require 'helper' | ||
|
||
describe Twitter::Cursor do | ||
|
||
describe "#first?" do | ||
context "when previous cursor equals zero" do | ||
before do | ||
@cursor = Twitter::Cursor.new({'previous_cursor' => 0}, 'ids') | ||
end | ||
it "should return true" do | ||
@cursor.first?.should be_true | ||
end | ||
end | ||
context "when previous cursor does not equal zero" do | ||
before do | ||
@cursor = Twitter::Cursor.new({'previous_cursor' => 1}, 'ids') | ||
end | ||
it "should return true" do | ||
@cursor.first?.should be_false | ||
end | ||
end | ||
end | ||
|
||
describe "#last?" do | ||
context "when next cursor equals zero" do | ||
before do | ||
@cursor = Twitter::Cursor.new({'next_cursor' => 0}, 'ids') | ||
end | ||
it "should return true" do | ||
@cursor.last?.should be_true | ||
end | ||
end | ||
context "when next cursor does not equal zero" do | ||
before do | ||
@cursor = Twitter::Cursor.new({'next_cursor' => 1}, 'ids') | ||
end | ||
it "should return false" do | ||
@cursor.last?.should be_false | ||
end | ||
end | ||
end | ||
|
||
end |