From 86acdf4477c7cf32bd82ff572d6a96c2ad161e9a Mon Sep 17 00:00:00 2001 From: ryanss Date: Sun, 22 Mar 2015 23:59:00 -0400 Subject: Add tests for different item types --- tests.vader | 42 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/tests.vader b/tests.vader index cee9a9b..3aa9ad7 100644 --- a/tests.vader +++ b/tests.vader @@ -76,9 +76,47 @@ Expect (Keys Mapped): u *@:Python hackernews.save_pos()u:Python hackernews.recall_pos() *@:Python hackernews.save_pos():Python hackernews.recall_pos() -Do (Test opening `link` type): +Do (Test opening link item w/ url): :HackerNews\ cc[9015621]\o -Then (Test `link` opened): +Then (Test link w/ url opened): AssertEqual getline(1), 'Show HN: vim-hackernews (github.com)' + AssertEqual getline(3), '[http://news.ycombinator.com/item?id=9015621]' + +Do (Test opening link item w/ content): + :HackerNews\ + cc[1474094]\o + +Then (Test link w/ content opened): + AssertEqual getline(1), 'Ask HN: What were your naivetés in your twenties?' + AssertEqual getline(3), '[http://news.ycombinator.com/item?id=1474094]' + AssertEqual getline(5), 'Oh the wise elders of Hack News,' + +Do (Test opening poll item): + :HackerNews\ + cc[5736367]\o + +Then (Test poll item opened): + AssertEqual getline(1), 'Poll: Which is your primary text editor?' + AssertEqual getline(3), '[http://news.ycombinator.com/item?id=5736367]' + AssertEqual strpart(getline(5), 0, 2), 'Vi' + AssertEqual getline(6), '################################################################################' + +Do (Test opening comment item): + :HackerNews\ + cc[9015621]\o + :36\o + +Then (Test comment item opened): + AssertEqual strpart(getline(1), 0, 17), 'Comment by atmosx' + AssertEqual strpart(getline(7), 0, 21), ' Comment by ryanss' + +Do (Test opening job item): + :HackerNews\ + cc[9250739]\o + +Then (Test job item opened): + AssertEqual getline(1), 'Love Devops? Aptible Is Hiring Senior Platform Engineers' + AssertEqual getline(3), '[http://news.ycombinator.com/item?id=9250739]' + AssertEqual getline(5), '_Brooklyn/Remote_' -- cgit v1.2.3