Sha256: fa0d71aeee801b2a7e65a10bf59fe8ebbc91d0af3d4ca5571dfe9917a7c36da5

Contents?: true

Size: 1.05 KB

Versions: 16

Compression:

Stored size: 1.05 KB

Contents

# Stella Test Plan - Using Variables (2009-12-04)
#
#
# 1. START THE EXAMPLE APPLICATION
# 
# This test plan is written to work with the
# example application that ships with Stella. 
# See:
#
# $ stella example
#
# 2. RUN THE TESTPLAN
#
# $ stella --var globalvar=smoked verify -p examples/variables/plan.rb
#
#
usecase "Form Example" do
  set :uri => 'http://localhost:3114'
  set :apple => resource(:globalvar)
  
  # Variables can be used in the request URIs. Stella looks
  # for a replacement value in the usecase resources, then
  # in the params, and then in global variables. 
  get ":uri" do
  end
  
  # URI variables can also be specified with a dollar sign. 
  get "$uri/search" do
    param :what => resource(:globalvar)
    response do
      if resource(:globalvar).nil?
        abort "Usage: stella --var globalvar=smoked verify -p examples/variables/plan.rb"
      end
      puts "  Global variable: " << resource(:globalvar)
      puts "  Usecase variable: " << resource(:uri)
      puts "  Usecase copy of global: " << resource(:apple)
    end
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
stella-0.8.8.001 examples/variables/plan.rb
stella-0.8.7.003 examples/variables/plan.rb
stella-0.8.7.002 examples/variables/plan.rb
stella-0.8.7.001 examples/variables/plan.rb
stella-0.8.6.002 examples/variables/plan.rb
stella-0.8.6.001 examples/variables/plan.rb
stella-0.8.5.002 examples/variables/plan.rb
stella-0.8.5.001 examples/variables/plan.rb
stella-0.8.4.001 examples/variables/plan.rb
stella-0.8.3.002 examples/variables/plan.rb
stella-0.8.3.001 examples/variables/plan.rb
stella-0.8.2.003 examples/variables/plan.rb
stella-0.8.2.002 examples/variables/plan.rb
stella-0.8.2.001 examples/variables/plan.rb
stella-0.8.1.002 examples/variables/plan.rb
stella-0.8.1.001 examples/variables/plan.rb