Skip to content

Instantly share code, notes, and snippets.

@liangzan
Created December 11, 2009 08:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save liangzan/254064 to your computer and use it in GitHub Desktop.
Save liangzan/254064 to your computer and use it in GitHub Desktop.
When /^I follow the PDF link "([^\"]+)"$/ do |link|
File.open($pdf_file_path, "w") do |file|
file.puts find_link(link).download.readlines
end
end
#note that the pdf reader removes all white spaces
Then /^I should see "([^\"]+)" on page "(\d+)"$/ do |text, page|
(pdf_reader.content[page.to_i - 1] =~/#{text}/).present?.should == true
end
Then /^the pdf document should have "(\d+)" pages$/ do |pages|
pdf_reader.content.size.should == pages.to_i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment