torrents 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/lib/torrents.rb CHANGED
@@ -119,9 +119,12 @@ class Torrents < Container::Shared
119
119
  end
120
120
 
121
121
  def results
122
- return @torrents if @torrents.any? and not @step
122
+ @torrents = [] if @step
123
+ return @torrents if @torrents.any?
124
+
123
125
  counter = 0
124
126
  rejected = 0
127
+
125
128
  self.inner_torrents(self.content).each do |tr|
126
129
  counter += 1
127
130
 
@@ -232,8 +232,8 @@ describe Torrents do
232
232
  context "the step method" do
233
233
  it "should be possible to step from 0 to 10" do
234
234
  10.times do |n|
235
- RestClient.should_receive(:get).with("http://thepiratebay.org/recent/#{n}", {:timeout => 10, :cookies => nil}).exactly(1).times.and_return("")
236
- @torrents.step.results
235
+ RestClient.should_receive(:get).with("http://thepiratebay.org/recent/#{n}", {:timeout => 10, :cookies => nil}).exactly(1).times.and_return(File.read("spec/data/the_pirate_bay/recent.html"))
236
+ @torrents.step.should have(30).results
237
237
  end
238
238
  end
239
239
  end
data/torrents.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "torrents"
6
- s.version = "1.0.3"
6
+ s.version = "1.0.4"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Linus Oleander"]
9
9
  s.email = ["linus@oleander.nu"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: torrents
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.0.3
5
+ version: 1.0.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Linus Oleander