Sha256: e5c6179b4414a5146e6dbb7f1e2fe19f0b0c5cf01d7b069328266278f956a654

Contents?: true

Size: 667 Bytes

Versions: 12

Compression:

Stored size: 667 Bytes

Contents

module Helpers
  module History
    def visited_once?(url)
      return @agent.visited_urls.select { |visited_url|
        visited_url == url
      }.length == 1
    end

    def visited_link?(url)
      @agent.visited?(url)
    end

    def visit_failed?(url)
      @agent.failed?(url)
    end

    def should_visit_link(url)
      visited_link?(url).should == true
    end

    def should_ignore_link(url)
      visited_link?(url).should == false
    end

    def should_visit_once(url)
      visited_once?(url).should == true
    end

    def should_fail_link(url)
      visited_link?(url).should == false
      visit_failed?(url).should == true
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
spidr_epg-1.0.0 spec/helpers/history.rb
spidr-0.4.1 spec/helpers/history.rb
spidr-0.4.0 spec/helpers/history.rb
spidr-0.3.2 spec/helpers/history.rb
spidr-0.3.1 spec/helpers/history.rb
spidr-0.3.0 spec/helpers/history.rb
spidr-0.2.7 spec/helpers/history.rb
spidr-0.2.6 spec/helpers/history.rb
spidr-0.2.5 spec/helpers/history.rb
spidr-0.2.4 spec/helpers/history.rb
spidr-0.2.3 spec/helpers/history.rb
spidr-0.2.2 spec/helpers/history.rb