hnruby 0.02 → 0.02.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/hnruby/storylist.rb +1 -0
- data/test/test_hackernews.rb +15 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99add1eaf94c0992be38aa5b524927b9d41bd001
|
4
|
+
data.tar.gz: 54110db3e60b83a1f215dbb3e030385bff2bd7b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3ef7270a60173175ed143673b5117c64bf5bc72d42b9a6ca0f270fbfb983e4efd2ea2d2b4d44bf6ca65502b2eeb12ae3a6735757b73b1ac5ec0fe116beadad1
|
7
|
+
data.tar.gz: 06b7e51e4a0a05ac6b42a025c82fd5d2375418788cb0ef1f2a8cdd517adfdec5d70a01c224767b49aa8fd6f20816d251e538610ac2d5cc103743297012a57120
|
data/lib/hnruby/storylist.rb
CHANGED
data/test/test_hackernews.rb
CHANGED
@@ -40,6 +40,21 @@ class TestHackerNews < Test::Unit::TestCase
|
|
40
40
|
assert joboffer.joboffer?
|
41
41
|
assert_equal nil, joboffer.submitter_url
|
42
42
|
assert_equal nil, joboffer.comment_url
|
43
|
+
|
44
|
+
showhn = HackerNews::StoryList.get_by(2){|i|i.title.start_with? "Show HN"}.last
|
45
|
+
assert_equal 28, showhn.number
|
46
|
+
assert_equal "http://bistro.is", showhn.url
|
47
|
+
assert_equal "Show HN: Online Reputation Management for Restaurants",
|
48
|
+
showhn.title
|
49
|
+
assert_equal 3, showhn.points
|
50
|
+
assert_equal "zachflower", showhn.submitter
|
51
|
+
assert_equal "12 minutes ago", showhn.time
|
52
|
+
assert_equal 0, showhn.comments
|
53
|
+
assert showhn.article?
|
54
|
+
assert !showhn.joboffer?
|
55
|
+
assert_equal "https://news.ycombinator.com/user?id=zachflower",
|
56
|
+
showhn.submitter_url
|
57
|
+
assert_equal "https://news.ycombinator.com/item?id=6641994", showhn.url
|
43
58
|
end
|
44
59
|
|
45
60
|
def test_comments
|