describe "PM::Table module indexable" do before do @screen = TableScreenIndexable.new end it "should automatically return the first letter of each section" do result = %w{ A G M O S U } @screen.sectionIndexTitlesForTableView(@screen.table_view).should == result end end describe "PM::Table module indexable with nil section title" do before do @screen = TableScreenIndexableNil.new end it "should not crash when a section title is nil" do result = %w{ A G M O S U } @screen.sectionIndexTitlesForTableView(@screen.table_view).should == result.push(" ") end end describe "PM::Table module indexable/searchable" do before do @screen = TableScreenIndexableSearchable.new end it "should automatically return the first letter of each section" do result = %w{ {search} A G M O S U } @screen.sectionIndexTitlesForTableView(@screen.table_view).should == result end end