From: Michael Boutros Date: 2008-12-25T09:45:10+09:00 Subject: Re: Testing Data Scrapes Thomas, Thanks for the response. That's a good idea, but after that, what? I would need to test the data against hard data, wouldn't I? And if each person running the tests has a different set of credentials, then the hard data would work only for me. Or were you talking about doing that just to test to make sure methods return proper instances of Array, GoogleSpreadsheet, etc.? - Michael Boutros Thomas Preymesser wrote: > 2008/12/25 Michael Boutros : >> Hello all, >> >> I'm here not for code help, but more for some opinions. At the moment >> I'm writing a library to interact with Snipt. However, I have no idea >> how to test it. I don't want to include my username and password in the >> tests, > > I'm doing it this way: > > # Creates a new Google spreadsheet object. > def initialize(spreadsheetkey,user=nil,password=nil) > @filename = spreadsheetkey > @spreadsheetkey = spreadsheetkey > @user = user > @password = password > unless user > user = ENV['GOOGLE_MAIL'] > end > unless password > password = ENV['GOOGLE_PASSWORD'] > end > > so, if i do not provide the username and password from the test script > it will be taken from environment variables. > > -Thomas -- Posted via http://www.ruby-forum.com/.