Created
December 11, 2009 08:24
-
-
Save liangzan/254064 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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