Module: AppTester Abstract
- Defined in:
- lib/app-tester.rb,
lib/app-tester/core.rb,
lib/app-tester/test.rb,
lib/app-tester/timer.rb,
lib/app-tester/utils.rb,
lib/app-tester/parser.rb,
lib/app-tester/checker.rb,
lib/app-tester/options.rb,
lib/app-tester/connection.rb,
lib/app-tester/exceptions.rb,
lib/app-tester/utils/colors.rb,
lib/app-tester/utils/strings.rb
Overview
This module is abstract.
AppTester main module and namespace
Defined Under Namespace
Modules: Checker, Error, Utils Classes: Connection, Core, Options, Parser, Test, Timer
Constant Summary collapse
- VERSION =
'0.1.0'
Class Attribute Summary collapse
-
.options ⇒ Object
readonly
Returns the value of attribute options.
-
.tests ⇒ Object
readonly
Returns the value of attribute tests.
Class Method Summary collapse
-
.define_test(name = "") { ... } ⇒ AppTester::Test, NilClass
Create a new test object.
-
.get_test(name) ⇒ AppTester::Test
Retrieve a test by name.
-
.load_libraries(*libs) ⇒ NilClass
(also: load_library)
Load libraries to be used under this namespace.
-
.new {|options| ... } ⇒ AppTester
Construct AppTester framework.
-
.run_test(name, arguments = ARGV) ⇒ AppTester::Test
Run a test.
-
.set_options_for(name) {|options_parser| ... } ⇒ AppTester::Test
Defines command line options for a given test.
Class Attribute Details
.options ⇒ Object (readonly)
Returns the value of attribute options.
13 14 15 |
# File 'lib/app-tester.rb', line 13 def @options end |
.tests ⇒ Object (readonly)
Returns the value of attribute tests.
14 15 16 |
# File 'lib/app-tester.rb', line 14 def tests @tests end |
Class Method Details
.define_test(name = "") { ... } ⇒ AppTester::Test, NilClass
Create a new test object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/app-tester.rb', line 55 def define_test name="", &block if name.empty? raise AppTester::Error::NameEmptyError, "Attempted to define a test without a name" else if block_given? @tests[name.to_sym] = AppTester::Test.new(name, @options, &block) else @tests[name.to_sym] = nil end end end |
.get_test(name) ⇒ AppTester::Test
Retrieve a test by name
84 85 86 87 |
# File 'lib/app-tester.rb', line 84 def get_test name raise AppTester::Error::TestNotFoundError, "Could not find test #{name}" unless @tests.keys.include?(name.to_sym) @tests[name.to_sym] end |
.load_libraries(*libs) ⇒ NilClass Also known as: load_library
Load libraries to be used under this namespace
155 156 157 158 159 |
# File 'lib/app-tester.rb', line 155 def load_libraries *libs libs.each do |lib| require_relative "app-tester/#{lib}" end end |
.new {|options| ... } ⇒ AppTester
Construct AppTester framework
28 29 30 31 32 33 |
# File 'lib/app-tester.rb', line 28 def new @tests = {} @options = AppTester::Options.new yield @options if block_given? self end |
.run_test(name, arguments = ARGV) ⇒ AppTester::Test
Run a test
144 145 146 147 148 |
# File 'lib/app-tester.rb', line 144 def run_test name, arguments=ARGV the_test = get_test(name) the_test.run(arguments) the_test end |
.set_options_for(name) {|options_parser| ... } ⇒ AppTester::Test
Defines command line options for a given test
111 112 113 114 115 |
# File 'lib/app-tester.rb', line 111 def name test = get_test name yield test.parser test end |