Skip to content

Commit

Permalink
add method errors
Browse files Browse the repository at this point in the history
  • Loading branch information
noguchi999 committed May 3, 2012
1 parent 7ab9cf0 commit 054111c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/weblinks_spec.rb
Expand Up @@ -27,4 +27,10 @@

results.size.should eql 43
end

it "method errors should return Array size 4" do
results = @weblinks.errors

results.size.should eql 4
end
end
7 changes: 7 additions & 0 deletions weblinks.rb
Expand Up @@ -36,6 +36,13 @@ def to_a
@app_logs + @app_error_logs
end

def errors
return @app_error_logs unless @app_error_logs.empty?

execute
@app_error_logs
end

private
def execute
@agent.page.links.each do |link|
Expand Down

0 comments on commit 054111c

Please sign in to comment.