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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1bb2f5a4c8b8fa3b1b78dc9438863f0506be8a3
4
- data.tar.gz: dc9ab3e324b16719efd2f5e77734606d40ee76ad
3
+ metadata.gz: 99add1eaf94c0992be38aa5b524927b9d41bd001
4
+ data.tar.gz: 54110db3e60b83a1f215dbb3e030385bff2bd7b0
5
5
  SHA512:
6
- metadata.gz: 14030d713a3aeb6a065d6515913ae299f70f751ad1ea8d48ce841c4a0bc59fb01203c880c381b41cbd84b667b2624a8ec5d40659f0d05266bd8f2e0c4fa8220e
7
- data.tar.gz: 7904c487d791b218a9306f8405e1587779d5409c885fd53a6eb4a9025c4460bdb0cb38520e9ba496b1ba6de610df98c950844b43eaa02ddfa0c1d3b287537387
6
+ metadata.gz: a3ef7270a60173175ed143673b5117c64bf5bc72d42b9a6ca0f270fbfb983e4efd2ea2d2b4d44bf6ca65502b2eeb12ae3a6735757b73b1ac5ec0fe116beadad1
7
+ data.tar.gz: 06b7e51e4a0a05ac6b42a025c82fd5d2375418788cb0ef1f2a8cdd517adfdec5d70a01c224767b49aa8fd6f20816d251e538610ac2d5cc103743297012a57120
@@ -104,6 +104,7 @@ public
104
104
  i += 1
105
105
  items << at(i) if yield at(i)
106
106
  end
107
+ items
107
108
  rescue OpenURI::HTTPError #NOTE: May be unnecessary since page-loading's fixed
108
109
  items
109
110
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hnruby
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.02'
4
+ version: 0.02.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jem Orgun