### Home Classes Methods

### In Files

- lib/stella/testplan.rb

### Parent

Storable

### Namespace

- MODULE Stella::Usecase::ClassMethods

### Methods

- ::checkup
- ::from_hash
- ::inherited
- ::names
- ::new
- #freeze
- #id
- #postprocess
- #preprocess
- #ucid

### Included Modules

- Gibbler::Complex

### Files

- LICENSE.txt
- TODO

### Class/Module Index

Quicksearch

- Stella
- Stella::API
- Stella::API::Unauthorized
- Stella::Asserts
- Stella::CLI
- Stella::Client
- Stella::Common
- Stella::Common::PrivacyMethods
- Stella::ET
- Stella::Engine
- Stella::Engine::Base
- Stella::Engine::Base::ClassMethods
- Stella::Engine::Checkup
- Stella::EventTemplate
- Stella::ForcedRedirect
- Stella::HTTPError
- Stella::Log
- Stella::Log::HTTP
- Stella::PageError
- Stella::RT
- Stella::RepeatRequest
- Stella::Report
- Stella::Report::Content
- Stella::Report::Content::ReportMethods
- Stella::Report::Errors
- Stella::Report::Errors::ReportMethods
- Stella::Report::Headers
- Stella::Report::Metrics
- Stella::Report::Metrics::ReportMethods
- Stella::Report::Plugin
- Stella::Report::Plugin::ClassMethods
- Stella::Report::Statuses
- Stella::Report::Statuses::ReportMethods
- Stella::RequestError
- Stella::RequestTemplate
- Stella::Session
- Stella::StringTemplate
- Stella::TP
- Stella::Testplan
- Stella::Testplan::ClassMethods
- Stella::TestplanQuit
- Stella::Testrun
- Stella::TimeoutError
- Stella::UC
- Stella::Usecase
- Stella::Usecase::ClassMethods
- Stella::UsecaseError
- Stella::UsecaseFail
- Stella::Utils
- Stella::VERSION
- Addressable
- Addressable::URI
- Time
- Time::Units
- Array
- DefaultTestplan
- Float
- Hash
- MatchData
- MetricsPack
- Numeric
- Object
- OpenStruct
- StellaBehavior
- StellaError
- String
- Symbol
- Thread

No matching classes.

# Stella::Usecase

### Attributes

instance[RW]
registered_classes[R]

The class syntax uses the session method defined in ClassMethods. This is here for autogenerated usecases and ones loaded from JSON.

session[R]

The class syntax uses the session method defined in ClassMethods. This is here for autogenerated usecases and ones loaded from JSON.

testplan[RW]

### Public Class Methods

checkup(base_uri, opts={}) click to toggle source

    # File lib/stella/testplan.rb, line 254
    def checkup base_uri, opts={}
      (opts[:usecases] ||= []) << self
      testplan.checkup base_uri, opts
    end

from_hash(*args) click to toggle source

    # File lib/stella/testplan.rb, line 249
    def from_hash(*args)
      me = super(*args)
      me.requests.collect! { |req| Stella::RequestTemplate.from_hash(req) }
      me
    end

inherited(obj) click to toggle source

    # File lib/stella/testplan.rb, line 265
    def inherited(obj)
      super
      planclass, ucname = *obj.names
      planclass.extend Stella::Testplan::ClassMethods
      unless Stella::Testplan.plan? planclass
        Stella::Testplan.plan(planclass, planclass.new)
        Stella::Testplan.plan(planclass).desc = planclass
      end

      obj.instance = obj.new
      obj.testplan = Stella::Testplan.plan(planclass)
      Stella::Testplan.plan(planclass).usecases << obj.instance
      Stella::Testplan.plan(planclass).usecases.last.desc = ucname
      obj.extend ClassMethods
    end

names() click to toggle source

    # File lib/stella/testplan.rb, line 258
    def names
      names = self.to_s.split('::')
      planname, ucname = case names.size
      when 1 then ['DefaultTestplan', names.last]
      else        [names[0..-2].join('::'), names[-1]] end
      [eval(planname), ucname.to_sym]
    end

new(req=nil) click to toggle source

    # File lib/stella/testplan.rb, line 181
    def initialize(req=nil)
      preprocess
      @requests << req if req
    end

### Public Instance Methods

freeze() click to toggle source

    # File lib/stella/testplan.rb, line 196
    def freeze
      return if frozen?
      @requests.each { |r| r.freeze }
      @id &&= Gibbler::Digest.new(@id || self.digest)
      super
      self
    end

id() click to toggle source

    # File lib/stella/testplan.rb, line 185
    def id
      @id ||= gibbler
      @id
    end

Also aliased as: ucid
postprocess() click to toggle source

    # File lib/stella/testplan.rb, line 193
    def postprocess
      @id &&= Gibbler::Digest.new(@id)
    end

preprocess() click to toggle source

    # File lib/stella/testplan.rb, line 190
    def preprocess
      @requests ||= []
    end

ucid() click to toggle source
Alias for: id

[Validate]

Generated with the Darkfish Rdoc Generator 2.