Class: Magellan::Rake::ExpectedLinksTask

Inherits:
BaseMagellanTask show all
Defined in:
lib/magellan/rake/expected_links_task.rb

Instance Attribute Summary collapse

Attributes inherited from BaseMagellanTask

#explore_depth, #failure_log, #ignored_urls, #links_to_explore, #origin_url, #success_message

Instance Method Summary collapse

Methods inherited from BaseMagellanTask

#define

Constructor Details

#initialize(name = "magellan:check_links") ⇒ ExpectedLinksTask

Returns a new instance of ExpectedLinksTask.



12
13
14
15
16
# File 'lib/magellan/rake/expected_links_task.rb', line 12

def initialize(name="magellan:check_links")
  @success_message = "All expected links found!"
  @links_to_explore = [["a","href"]]
  super(name)
end

Instance Attribute Details

Returns the value of attribute patterns_and_expected_links.



10
11
12
# File 'lib/magellan/rake/expected_links_task.rb', line 10

def patterns_and_expected_links
  @patterns_and_expected_links
end

Instance Method Details

#create_observerObject



22
23
24
# File 'lib/magellan/rake/expected_links_task.rb', line 22

def create_observer
  Magellan::ExpectedLinksTracker.new(@patterns_and_expected_links)
end

#descriptionObject



18
19
20
# File 'lib/magellan/rake/expected_links_task.rb', line 18

def description
  "Explore #{@origin_url} and find check if all given patterns are matched"
end