### Home Classes Methods

### In Files

- lib/stella/client.rb

### Methods

- #assert_doc
- #assert_equals
- #assert_exists
- #assert_form
- #assert_keys
- #assert_list
- #assert_match
- #assert_matches
- #assert_object_keys
- #assert_object_values
- #assert_status

### 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::Asserts

### Public Instance Methods

assert_doc() click to toggle source

    # File lib/stella/client.rb, line 453
    def assert_doc
      fail 'No content' if doc.nil?
    end

assert_equals(expected, found) click to toggle source

    # File lib/stella/client.rb, line 496
    def assert_equals expected, found
      fail "Expected: #{expected}; Found: #{found}" unless expected == found
    end

assert_exists(v) click to toggle source

    # File lib/stella/client.rb, line 492
    def assert_exists v
      fail "Found nil value" if v.nil?
      fail "Found empty value" if v.empty?
    end

assert_form(name) click to toggle source

    # File lib/stella/client.rb, line 488
    def assert_form name
      assert_doc
      fail "No form called #{name}" unless form && form[name]
    end

assert_keys(expected_keys) click to toggle source

    # File lib/stella/client.rb, line 457
    def assert_keys expected_keys
      assert_doc
      found_keys = doc.keys.uniq.sort
      unless found_keys == expected_keys
        quit "Doc keys mismatch (#{found_keys})"
      end
    end

assert_list(key) click to toggle source

    # File lib/stella/client.rb, line 465
    def assert_list key
      assert_doc
      fail "#{key} is empty" if doc[key].nil? || doc[key].empty?
    end

assert_match(regex, found) click to toggle source
Alias for: assert_matches
assert_matches(regex, found) click to toggle source

    # File lib/stella/client.rb, line 499
    def assert_matches regex, found
      fail "Expected: #{regex}; Found: #{found}" unless regex.match(found)
    end

Also aliased as: assert_match
assert_object_keys(key, expected_keys) click to toggle source

    # File lib/stella/client.rb, line 470
    def assert_object_keys key, expected_keys
      assert_doc
      found_keys = doc[key].collect { |obj| obj.keys }.flatten.uniq.sort
      unless found_keys == expected_keys
        quit "Doc keys mismatch (#{found_keys})"
      end
    end

assert_object_values(key, object_key, expected_values) click to toggle source

    # File lib/stella/client.rb, line 478
    def assert_object_values key, object_key, expected_values
      expected_values = [expected_values] unless Array === expected_values
      expected_values = expected_values.collect { |v| v.to_s }.sort
      values_found = doc[key].collect { |obj| obj[object_key].to_s }
      values_found.sort!
      unless values_found.uniq == expected_values
        quit "#{key} contains unexpected values for #{object_key}: #{values_found.uniq}"
      end
    end

assert_status(expected) click to toggle source

    # File lib/stella/client.rb, line 503
    def assert_status expected
      fail "Expected: #{expected}; Found: #{res.status}" unless res.status.to_i == expected.to_i
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.