[rspec-users] Specifying spec and output format inline?

Adam Reed areed at relocationcentral.com
Mon Sep 17 15:14:20 EDT 2007

Howdy from Austin, TX.
I'm new to rspec, and am currently using it with the Watir testing
library for web testing.  I'm moving along at an ok pace so far, but I
had a question.
I just realized I could require 'spec' and forego running scripts from
the command line.  However, this limits me in my output formats.  Is
there a way that I can specify which format to use and where to save it
inside the script?
I've included the full script below.
$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 ==
__FILE__   #set the local dir path
require 'watir'
require 'spec'
describe "Project name" do
  before(:all) do
    @browser = Watir::IE.new
    @browser.goto "http://localhost:8080/admin_frnPkg_add.html
<http://localhost:8080/admin_frnPkg_add.html> "
  end #begin
  ## Basic page validation
  it "should have the logo" do
    @browser.image(:src, /cp_logo.gif/).should_not be_nil
  end #logo
  it "should have login/logout text" do
    login = @browser.table(:index, 1)[2][1].text
    login.should =~ (/Log/)
  end #login/logout
  after(:all) do
  end #after
end #Project name
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070917/a4e9ec95/attachment.html 

More information about the rspec-users mailing list