I would post this on a Ruby forum, on on Stack Overflow with a Ruby tag. What you are asking is pretty basic stuff in terms of defining classes and methods in ruby. You should be able to find the answers you need by reading any number of good books on basic ruby programming. For testers who will be using ruby mostly as a scripting tool I recommend the book "Everyday Scripting with Ruby" by Brian Marick.
Likely you will need two methods if you want to call each on on it's own, not a single method. On Nov 21, 8:45 am, meaculpa <harismah...@gmail.com> wrote: > Consider I have a ruby file called library.rb. In which i defined a > function like this : > > def Name(testcase, result) > > pdf = PDF::Writer.new > testcase= $testcase > pdf.text $testcase, :font_size => 72, :justification => :center > > result= $result > pdf.text $result, :font_size => 72, :justification => :center > > end > > now i have another ruby file named web.rb which calls thus library.rb. > > My Problem is I need to pass these arguments separately. > > Means , I need to call Testcase argument firstly and then after many > conditions I need to pass result as Pass or fail. > > The Testcase is like I am doing a web automation and the library.rb is > the report part where From the web.rb I need to pass the testcase name > and then at the end I need to pass end result. > > Please help me to do this. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com