-
Notifications
You must be signed in to change notification settings - Fork 5
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
1 parent
914daed
commit afa1b34
Showing
2 changed files
with
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
require "../../spec_helper" | ||
|
||
# TODO: Use a mock. | ||
private class TestItem < Spectator::Core::Item | ||
end | ||
|
||
describe Spectator::Core::Item do | ||
describe "#description" do | ||
it "is the string passed to #initialize" do | ||
item = TestItem.new("foo") | ||
item.description.should eq("foo") | ||
end | ||
|
||
it "is nil if the item does not have a description" do | ||
item = TestItem.new | ||
item.description?.should be_nil | ||
end | ||
|
||
it "is the result of #inspect when passing a non-string to #initialize" do | ||
item = TestItem.new(:xyz) | ||
item.description.should eq(":xyz") | ||
end | ||
end | ||
|
||
describe "#location" do | ||
it "is the value passed to #initialize" do | ||
location = Spectator::Core::LocationRange.new("foo", 10) | ||
item = TestItem.new("foo", location) | ||
item.location.should eq(location) | ||
end | ||
end | ||
end |
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