handlers/kinetic_submission_update_attribute_v1/handler/vendor/ars-models-0.0.7/test/test_helper.rb
# Enable a setup and teardown method that is executed at the beginning
# and end of each TestSuite.  TestSuite setup and teardown methods are
# defined as class methods in the Test::Unit::TestCase.  For example:
#
#   UsersTest < Test::Unit::TestCase
#     # This will get executed before any of the tests are run
#     def self.setup
#       puts "Starting the test suite..."
#     end
#
#     # This will get executed after all of the tests are run
#     def self.teardown
#       puts "Completed test suite."
#     end
#
#     # This will get executed before each of the tests are run
#     def setup
#       puts "Starting test..."
#     end
#
#     # This will get executed after each any of the tests are run
#     def self.teardown
#       puts "Completed."
#     end
#   end
Enable a setup and teardown method that is executed at the beginning
and end of each TestSuite.  TestSuite setup and teardown methods are
defined as class methods in the Test::Unit::TestCase.  For example.

UsersTest < Test::Unit::TestCase
This will get executed before any of the tests are run
def self.setup
puts "Starting the test suite..."
end

This will get executed after all of the tests are run
def self.teardown
puts "Completed test suite."
end

This will get executed before each of the tests are run
def setup
puts "Starting test..."
end

This will get executed after each any of the tests are run
def self.teardown
puts "Completed."
end
end
Enable a setup and teardown method that is executed at the beginning and end of each TestSuite . TestSuite setup and teardown methods are defined as class methods in the Test :: Unit :: TestCase . For example . UsersTest < Test :: Unit :: TestCase This will get executed before any of the tests are run def self . setup puts " Starting the test suite ... " end This will get executed after all of the tests are run def self . teardown puts " Completed test suite . " end This will get executed before each of the tests are run def setup puts " Starting test ... " end This will get executed after each any of the tests are run def self . teardown puts " Completed . " end end
def suite_with_callbacks
      suite = suite_without_callbacks
      class << suite
        attr_accessor :test_case
        def run_with_callbacks(result, &progress_block)
          test_case.setup if test_case.respond_to?(:setup)
          begin
            run_without_callbacks(result, &progress_block)
          ensure
            test_case.teardown if test_case.respond_to?(:teardown)
          end
        end
        alias_method :run_without_callbacks, :run
        alias_method :run, :run_with_callbacks
      end
      suite.test_case = self
      suite
    end
def suite_with_callbacks suite = suite_without_callbacks class << suite attr_accessor :test_case def run_with_callbacks ( result , & progress_block ) test_case . setup if test_case . respond_to? ( :setup ) begin run_without_callbacks ( result , & progress_block ) ensure test_case . teardown if test_case . respond_to? ( :teardown ) end end alias_method :run_without_callbacks , :run alias_method :run , :run_with_callbacks end suite . test_case = self suite end
Enable a setup and teardown method that is executed at the beginning
and end of each TestSuite.
Enable a setup and teardown method that is executed at the beginning and end of each TestSuite .
# Retrieve the suite as it is built normally # Modify the class methods for the suite instance # Add an attribute to store a link to the generating test case # Define the alias wrapper method # Run setup if its defined # Run all of the tests # Run teardown if it is defined # Set the link to tie the suite to the source TestCase # Return the suite