Skip to content

Commit

Permalink
Added test for resorting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ciaranarcher committed Dec 31, 2012
1 parent 5d15117 commit 7bd0a19
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app.rb
Expand Up @@ -4,4 +4,4 @@

page = HackerTerm::PageData.new File.read './data/data.json'
win = HackerTerm::UI.new
win.show page
win.show page
9 changes: 8 additions & 1 deletion spec/hacker_term_spec.rb
Expand Up @@ -124,7 +124,14 @@ module HackerTerm
@pd.data.last['title'].should == 'First Article'
end

it 'sorts by rank of comments when requested' do
it 'sorts by rank when requested' do
@pd.sort_on!(:rank)
@pd.data.first['title'].should == 'First Article'
@pd.data.last['title'].should == 'Third Article'
end

it 're-sorts by rank when requested' do
@pd.sort_on!(:comments)
@pd.sort_on!(:rank)
@pd.data.first['title'].should == 'First Article'
@pd.data.last['title'].should == 'Third Article'
Expand Down

0 comments on commit 7bd0a19

Please sign in to comment.